forked from wafersystems/react-position-select
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
executable file
·43 lines (39 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
37
38
39
40
41
42
43
import babel from 'rollup-plugin-babel'
import commonjs from 'rollup-plugin-commonjs'
import postcss from 'rollup-plugin-postcss'
import resolve from 'rollup-plugin-node-resolve'
import url from 'rollup-plugin-url'
import pkg from './package.json'
// Do this as the first thing so that any code reading it knows the right env.
process.env.BABEL_ENV = 'production';
process.env.NODE_ENV = 'production';
const externalIds = ['antd-mobile','lodash', 'prop-types', 'react', 'react-dom'];
export default {
input: 'src/index.js',
output: [
{
file: 'dist/index.js',
format: 'cjs',
sourcemap: true
},
{
file: 'dist/index.es.js',
format: 'es',
sourcemap: true
}
],
external: function(id, parent, isResolved) {
return !!(id && externalIds.some(e => id.startsWith(e)))
},
plugins: [
postcss({
modules: true
}),
url(),
babel({
exclude: ['node_modules/**']
}),
resolve(),
commonjs({})
]
}