-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathrollup.config.js
More file actions
executable file
·46 lines (44 loc) · 857 Bytes
/
rollup.config.js
File metadata and controls
executable file
·46 lines (44 loc) · 857 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
36
37
38
39
40
41
42
43
44
45
46
import resolve from 'rollup-plugin-node-resolve'
import babel from 'rollup-plugin-babel'
import uglify from 'rollup-plugin-uglify'
const needMin = !!process.env.MIN
let file = 'dist/smart-observe.js'
const plugins = [
resolve({
jsnext: true,
browser: true,
}),
babel({
presets: [
['env', {
targets: {
browsers: ['last 3 versions', 'IE >= 9'],
node: '4'
},
modules: false
}]
],
plugins: [
'transform-class-properties',
'external-helpers'
],
})
]
if (needMin) {
file = 'dist/smart-observe.min.js'
plugins.push(uglify())
}
export default {
input: 'src/index.js',
output: {
file,
format: 'umd',
name: 'observe',
banner:
`/**
* smart-observe --- By lon
* https://github.com/cnlon/smart-observe
*/`,
},
plugins,
}