-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrollup.config.js
36 lines (34 loc) · 990 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
const babel = require('@rollup/plugin-babel').default;
const resolve = require('@rollup/plugin-node-resolve').default;
const commonjs = require('@rollup/plugin-commonjs');
const peerDepsExternal = require('rollup-plugin-peer-deps-external');
const production = !process.env.ROLLUP_WATCH;
module.exports = {
input: 'src/index.js',
output: [
{
file: 'dist/index.js',
format: 'cjs',
sourcemap: !production,
},
{
file: 'dist/index.esm.js',
format: 'esm',
sourcemap: !production,
},
],
plugins: [
peerDepsExternal(),
resolve({
extensions: ['.js', '.jsx']
}),
babel({
exclude: 'node_modules/**',
presets: ['@babel/preset-env', '@babel/preset-react'],
extensions: ['.js', '.jsx'],
babelHelpers: 'bundled'
}),
commonjs()
],
external: ['react', 'react-dom']
};