-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathrollup.config.js
49 lines (45 loc) · 1.04 KB
/
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
47
48
49
import commonjs from 'rollup-plugin-commonjs';
import filesize from 'rollup-plugin-filesize';
import resolve from 'rollup-plugin-node-resolve';
import sourceMaps from 'rollup-plugin-sourcemaps';
import uglify from 'rollup-plugin-uglify';
const shared = {
entry: `compiled/formik-effect.js`,
sourceMap: true,
external: ['react', 'formik', 'prop-types'],
globals: {
react: 'React',
formik: 'formik',
'prop-types': 'PropTypes',
},
exports: 'named',
};
export default [
Object.assign({}, shared, {
moduleName: 'FormikEffect',
format: 'umd',
dest: 'dist/formik-effect.umd.js',
plugins: [
resolve(),
commonjs({
include: /node_modules/,
}),
sourceMaps(),
filesize(),
uglify(),
],
}),
Object.assign({}, shared, {
targets: [
{ dest: 'dist/formik-effect.es6.js', format: 'es' },
{ dest: 'dist/formik-effect.js', format: 'cjs' },
],
plugins: [
resolve(),
commonjs({
include: /node_modules/,
}),
sourceMaps(),
],
}),
];