refactor(rollup): cleanup

This commit is contained in:
moklick
2019-10-07 22:23:15 +02:00
parent 72156e10e4
commit c6b96e923b
+31 -32
View File
@@ -11,36 +11,35 @@ import pkg from './package.json';
const isProd = process.env.NODE_ENV === 'production'; const isProd = process.env.NODE_ENV === 'production';
export default [{ export default [{
input: 'src/index.js', input: 'src/index.js',
external: ['react', 'react-dom', 'prop-types'], external: ['react', 'react-dom', 'prop-types'],
onwarn(warning, rollupWarn) { onwarn(warning, rollupWarn) {
if (warning.code !== 'CIRCULAR_DEPENDENCY') { if (warning.code !== 'CIRCULAR_DEPENDENCY') {
rollupWarn(warning); rollupWarn(warning);
} }
}, },
output: { output: {
name: 'ReactFlow', name: 'ReactFlow',
file: pkg.browser, file: pkg.browser,
format: 'umd', format: 'umd',
sourcemap: isProd, sourcemap: isProd,
globals: { globals: {
react: 'React', react: 'React',
'react-dom': 'ReactDOM', 'react-dom': 'ReactDOM',
'prop-types': 'PropTypes' 'prop-types': 'PropTypes'
} }
}, },
plugins: [ plugins: [
bundleSize(), bundleSize(),
postcss(), postcss(),
resolve(), resolve(),
babel({ babel({
exclude: 'node_modules/**' exclude: 'node_modules/**'
}), }),
commonjs({ commonjs({
include: /node_modules/ include: /node_modules/
}), }),
visualizer(), visualizer(),
isProd && uglify() isProd && uglify()
] ]}
}
]; ];