-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
42 lines (39 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 nodeResolve from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs'
import babel from 'rollup-plugin-babel'
import json from 'rollup-plugin-json'
import flow from 'rollup-plugin-flow'
import uglify from 'rollup-plugin-uglify'
import { minify } from 'uglify-js-harmony'
// FIXME: use this plugin when https://github.com/btd/rollup-plugin-visualizer/pull/5 is merged
// import visualizer from 'rollup-plugin-visualizer'
const targets = [
{ dest: 'dist/index.js', format: 'cjs' },
{ dest: 'dist/index.es.js', format: 'es' },
]
const plugins = [
flow(),
nodeResolve(),
commonjs(),
babel({
babelrc: false,
plugins: [
'transform-flow-strip-types',
'external-helpers',
],
presets: [
['env', { modules: false, targets: { node: 4 } }],
],
}),
json(),
uglify({}, minify),
// visualizer({ filename: './bundle.stats.html' }),
]
export default {
entry: 'src/index.js',
moduleName: 'styled',
external: ['fs', 'node-sass', 'path'],
exports: 'named',
targets,
plugins,
}