-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
rollup.config.js
52 lines (48 loc) · 1.07 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
51
52
import babel from 'rollup-plugin-babel';
import { terser } from 'rollup-plugin-terser';
const isMinify = process.env.BUILD_MINIFY ? true : false;
const globalsVariables = {
'react': 'React',
'prop-types': 'PropTypes',
'paging-algorithm': 'PagingAlgorithm'
};
let output = [
{
file: 'dist/react-paginating.cjs.js',
name: 'react-paginating-cjs',
format: 'cjs',
globals: globalsVariables,
},
{
file: 'dist/react-paginating.esm.js',
name: 'react-paginating-esm',
format: 'esm'
},
{
file: 'dist/react-paginating.umd.js',
name: 'react-paginating-umd',
format: 'umd',
sourcemap: true,
globals: globalsVariables,
},
];
if (isMinify) {
output = {
file: 'dist/react-paginating.umd.min.js',
name: 'react-paginating.umd.min',
format: 'iife',
sourcemap: true,
globals: globalsVariables,
};
}
export default [{
input: 'src/Pagination/index.js',
output,
plugins: [
babel({
exclude: 'node_modules/**'
}),
isMinify ? terser() : null
],
external: ['react', 'prop-types', 'paging-algorithm'],
}];