-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathrollup.base.config.js
37 lines (36 loc) · 1.03 KB
/
rollup.base.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
import json from '@rollup/plugin-json';
import resolve from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import * as react from 'react';
import * as reactDom from 'react-dom';
import babel from 'rollup-plugin-babel';
import commonjs from 'rollup-plugin-commonjs';
import filesize from 'rollup-plugin-filesize';
import { terser } from 'rollup-plugin-terser';
export const plugins = [
commonjs({
namedExports: {
// Source: https://github.com/rollup/rollup-plugin-commonjs/issues/290#issuecomment-537683484
react: Object.keys(react),
'react-dom': Object.keys(reactDom),
},
}),
replace({
__DEV__: JSON.stringify(process.env.NODE_ENV === 'development'),
}),
json(),
resolve({
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
}),
babel({
exclude: 'node_modules/**',
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
rootMode: 'upward',
runtimeHelpers: true,
}),
terser(),
filesize({
showMinifiedSize: false,
showGzippedSize: true,
}),
];