-
Notifications
You must be signed in to change notification settings - Fork 68
/
rollup.config.js
42 lines (37 loc) · 1.03 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
import babel from 'rollup-plugin-babel'
import { uglify } from 'rollup-plugin-uglify'
import visualizer from 'rollup-plugin-visualizer'
const globals = {
react: 'React',
'styled-components': 'styled',
'prop-types': 'PropTypes',
'lodash.isinteger': '_.isInteger'
}
const name = 'react-styled-flexboxgrid'
const plugins = [
babel({
plugins: ['@babel/plugin-external-helpers']
})
]
const base = {
input: 'src/index.js',
external: ['react', 'styled-components', 'prop-types', 'lodash.isinteger'],
plugins
}
export default [
Object.assign({}, base, {
output: [
{ file: 'dist/styled-flexboxgrid.js', format: 'umd', exports: 'named', name, globals },
{ file: 'dist/styled-flexboxgrid.es.js', format: 'es', exports: 'named', name, globals }
]
}),
Object.assign({}, base, {
output: [
{ file: 'dist/styled-flexboxgrid.min.js', format: 'umd', exports: 'named', name, globals }
],
plugins: base.plugins.concat([
uglify(),
visualizer({ filename: './bundle-stats.html' })
])
})
]