forked from dongy7/react-animated-term
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
35 lines (32 loc) · 764 Bytes
/
rollup.config.js
File metadata and controls
35 lines (32 loc) · 764 Bytes
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
import babel from 'rollup-plugin-babel'
import resolve from 'rollup-plugin-node-resolve'
const path = 'dist/react-animated-term'
const globals = {
classnames: 'classNames',
'react-dom': 'ReactDOM',
react: 'React',
'prop-types': 'PropTypes'
}
const external = Object.keys(globals)
const babelOptions = (prod) => {
let options = {
babelrc: false,
presets: [['env', { modules: false }], 'stage-0', 'react'],
plugins: ['external-helpers']
}
if (prod) {
options.plugins.push('transform-react-remove-prop-types')
}
return options
}
export default [
{
input: 'src/index.js',
output: {
file: path + '.es.js',
format: 'es'
},
external: external,
plugins: [babel(babelOptions(false)), resolve()]
}
]