-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathrollup.config.babel.js
executable file
·63 lines (58 loc) · 1.43 KB
/
rollup.config.babel.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import babel from 'rollup-plugin-babel';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import replace from 'rollup-plugin-replace';
import postcss from 'rollup-plugin-postcss';
import image from 'rollup-plugin-img';
import autoExternal from 'rollup-plugin-auto-external';
const moduleOptions = {
name: 'PackardBelle',
globals: {
react: 'React',
'react-dom': 'ReactDOM',
clone: 'clone',
'prop-types': 'PropTypes',
classnames: 'classnames',
'react-select': 'ReactSelect',
},
sourcemap: true,
};
export default {
input: './src/index.js',
output: [
{
...moduleOptions,
file: './build/pb.js',
format: 'umd',
},
{
...moduleOptions,
file: 'build/pb.module.js',
format: 'es',
},
],
plugins: [
image({
output: './build/images', // default the root
extensions: /\.(png|jpg|jpeg|gif|svg)$/, // support png|jpg|jpeg|gif|svg, and it's alse the default value
limit: 8192, // default 8192(8k)
exclude: 'node_modules/**',
}),
postcss({
plugins: [],
// modules: true,
}),
resolve({
extensions: ['.mjs', '.js', '.jsx', '.json', '.node', '.ttf'],
}),
autoExternal(),
babel({
exclude: 'node_modules/**',
}),
replace({
'process.env.NODE_ENV': JSON.stringify('development'),
}),
commonjs(),
],
external: ['react', 'react-dom'],
};