forked from debut-js/Core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
42 lines (38 loc) · 1020 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
35
36
37
38
39
40
41
42
import typescript from 'rollup-plugin-typescript2';
import pkg from './package.json';
import { terser } from 'rollup-plugin-terser';
const tsConfig = {
tsconfigOverride: {
compilerOptions: { module: 'esnext' },
},
};
const debut = {
input: 'src/index.ts',
output: {
file: pkg.main,
format: 'cjs', // the preferred format
},
external: [...Object.keys(pkg.dependencies || {}), 'path', 'fs'],
plugins: [
typescript({ ...tsConfig }),
terser(), // minifies generated bundles
],
};
const cli = {
input: {
finder: 'src/cli/finder-cli.ts',
genetic: 'src/cli/genetic-cli.ts',
tester: 'src/cli/tester-cli.ts',
},
output: {
dir: 'lib/cli',
format: 'cjs',
banner: '#!/usr/bin/env node',
},
external: [...Object.keys(pkg.dependencies || {}), 'path', 'fs'],
plugins: [
typescript(tsConfig),
terser(), // minifies generated bundles
],
};
export default [cli, debut];