forked from jaredpalmer/formik-persist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
50 lines (46 loc) · 1.1 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
50
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-persist.js`,
sourceMap: true,
external: ['react', 'formik', 'prop-types', 'lodash.isequal'],
globals: {
react: 'React',
formik: 'formik',
'prop-types': 'PropTypes',
'lodash.isequal': 'lodash.isequal',
},
exports: 'named',
};
export default [
Object.assign({}, shared, {
moduleName: 'FormikPersist',
format: 'umd',
dest: 'dist/formik-persist.umd.js',
plugins: [
resolve(),
commonjs({
include: /node_modules/,
}),
sourceMaps(),
filesize(),
uglify(),
],
}),
Object.assign({}, shared, {
targets: [
{ dest: 'dist/formik-persist.es6.js', format: 'es' },
{ dest: 'dist/formik-persist.js', format: 'cjs' },
],
plugins: [
resolve(),
commonjs({
include: /node_modules/,
}),
sourceMaps(),
],
}),
];