1 | import path from 'path';
|
2 |
|
3 | import json from 'rollup-plugin-json';
|
4 | import babel from 'rollup-plugin-babel';
|
5 | import resolve from 'rollup-plugin-node-resolve';
|
6 |
|
7 | export default {
|
8 | dest: 'dist/index.js',
|
9 | entry: 'src/packages/cli/commands/index.js',
|
10 | format: 'cjs',
|
11 | banner: (
|
12 | 'require(\'source-map-support\').install({\n'
|
13 | + ' environment: \'node\'\n'
|
14 | + '});\n'
|
15 | ),
|
16 | onwarn: ({ code, message }) => {
|
17 | if (code === 'UNUSED_EXTERNAL_IMPORT') {
|
18 | return;
|
19 | }
|
20 |
|
21 | console.warn(message);
|
22 | },
|
23 | plugins: [
|
24 | json(),
|
25 | babel(),
|
26 | resolve()
|
27 | ],
|
28 | external: id => !(
|
29 | id.startsWith('.')
|
30 | || id.startsWith('/')
|
31 | || /^[A-Z]:[\\/]/.test(id)
|
32 | || id.startsWith('src')
|
33 | || id.startsWith(path.join(__dirname, 'src'))
|
34 | || id === 'babelHelpers'
|
35 | || id === '\u0000babelHelpers'
|
36 | ),
|
37 | sourceMap: true
|
38 | };
|