-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
34 lines (31 loc) · 898 Bytes
/
rollup.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { babel } from '@rollup/plugin-babel';
import json from '@rollup/plugin-json';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import typescript from '@rollup/plugin-typescript';
import fs from 'fs';
const pkg = JSON.parse(fs.readFileSync('./package.json'));
const external = Object.keys(pkg.dependencies || {}).concat(['fs/promises']);
const extensions = ['.js', '.ts', '.tsx'];
export default {
input: 'src/main.ts',
output: {
file: './bin/cli.js',
format: 'cjs',
banner: '#!/usr/bin/env node',
},
external,
plugins: [
nodeResolve({
extensions,
modulesOnly: true,
resolveOnly: ['react-dom/server']
}),
json(),
babel({
exclude: ['node_modules/**', './history/**'],
babelHelpers: 'bundled',
extensions,
}),
typescript({ compilerOptions: { lib: ['es5', 'es6', 'dom'], target: 'es5' } }),
],
};