-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrollup.config.js
44 lines (42 loc) · 911 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
43
44
import { sizeSnapshot } from 'rollup-plugin-size-snapshot';
import externals from 'rollup-plugin-node-externals';
import resolve from '@rollup/plugin-node-resolve';
import flowEntry from 'rollup-plugin-flow-entry';
import commonjs from '@rollup/plugin-commonjs';
import postcss from 'rollup-plugin-postcss';
import babel from '@rollup/plugin-babel';
import pkg from './package.json';
let plugins = [
externals(),
postcss({
modules: true,
extract: `${pkg.name}.css`,
}),
babel({
exclude: ['node_modules/**'],
babelHelpers: 'runtime',
}),
resolve(),
commonjs(),
sizeSnapshot(),
];
export default {
plugins,
input: 'src/index.js',
output: [
{
file: pkg.browser,
name: pkg.name,
format: 'umd',
},
{
file: pkg.main,
format: 'cjs',
plugins: [flowEntry()],
},
{
file: pkg.module,
format: 'esm',
},
],
};