-
Notifications
You must be signed in to change notification settings - Fork 12
/
rollup.config.js
35 lines (33 loc) · 825 Bytes
/
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
const babel = require('rollup-plugin-babel')
const changeCase = require('change-case')
const packageJson = require('./package.json')
process.env.BABEL_ENV = 'production'
module.exports = {
external: [
'element-resize-detector',
'invariant',
'lodash.debounce',
'lodash.throttle',
'prop-types',
'react-dom',
'react-sizeme',
'react',
],
input: 'src/index.js',
output: {
file: `dist/${packageJson.name}.js`,
format: 'cjs',
sourcemap: true,
name: changeCase
.titleCase(packageJson.name.replace(/-/g, ' '))
.replace(/ /g, ''),
},
plugins: [
babel({
babelrc: false,
exclude: 'node_modules/**',
presets: [['env', { modules: false }], 'stage-3', 'react'],
plugins: ['external-helpers', 'transform-class-properties'],
}),
],
}