-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
51 lines (47 loc) · 1.06 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
43
44
45
46
47
48
49
50
51
'use strict'
const buble = require('rollup-plugin-buble')
const gzip = require('rollup-plugin-gzip')
const uglify = require('rollup-plugin-uglify')
const resolve = require('rollup-plugin-node-resolve')
const commonjs = require('rollup-plugin-commonjs')
let config = {
entry: 'src/index.js'
}
if (process.env.BROWSER) {
config = Object.assign(config, {
dest: 'dist/mich-h.min.js',
format: 'umd',
moduleName: 'michH',
useStrict: false,
sourceMap: true,
plugins: [
resolve(),
commonjs(),
buble({
target: {
ie: '11',
edge: '12',
safari: '8',
chrome: '48',
firefox: '44'
}
}),
uglify({ compress: { warnings: false } }),
gzip()
]
})
} else {
config = Object.assign(config, {
plugins: [
buble({
target: { node: '4' }
})
],
external: ['mich-parse-selector'],
targets: [
{ dest: 'dist/mich-h.common.js', format: 'cjs' },
{ dest: 'dist/mich-h.es.js', format: 'es' }
]
})
}
module.exports = config