-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
46 lines (44 loc) · 1023 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
45
46
import { terser } from 'rollup-plugin-terser'
import { nodeResolve } from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import babel from '@rollup/plugin-babel'
export default {
input: 'src/index.js',
external: [
'mobx-state-tree',
'mobx',
'mobx-react',
'prop-types',
'react',
'react-dom',
'react-router-dom',
'styled-components',
'react-is',
'@hoc/plugins-core',
],
output: {
exports: 'named',
format: 'es',
file: 'dist/index.mjs',
sourcemap: true,
},
plugins: [
nodeResolve({
browser: true,
}),
babel({
exclude: /node_modules/,
presets: ['@babel/preset-env', '@babel/preset-react'],
plugins: [
['inline-react-svg'],
['@babel/plugin-transform-react-jsx'],
['@babel/plugin-proposal-class-properties', { loose: true }],
['transform-modern-regexp'],
],
babelHelpers: 'bundled',
}),
commonjs(),
terser(),
],
context: 'window',
}