forked from Kenshin/simpread-little
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
53 lines (51 loc) · 1.41 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
52
53
import resolve from 'rollup-plugin-node-resolve';
import babel from 'rollup-plugin-babel';
import uglify from 'rollup-plugin-uglify';
import common from 'rollup-plugin-commonjs';
import builtin from 'rollup-plugin-node-builtins';
const plugins = [
builtin(),
resolve({
jsnext : true,
main : true,
browser: true,
}),
common(),
babel({
presets: [ 'es2015-rollup', 'stage-0' ],
exclude: 'node_modules/**'
}),
( process.env.NODE_ENV === 'production' && uglify({
compress: {
sequences: true,
dead_code: true,
conditionals: true,
booleans: true,
unused: true,
if_return: true,
join_vars: true,
drop_console: true
},
output: {
comments: false
}
})),
];
export default [
{
input : './src/userscript/simpread.js',
output : {
format : 'iife',
file : process.env.NODE_ENV === 'production' ? './dist/simpread.user.min.js' : './dist/simpread.user.js',
},
plugins,
},
{
input : './src/bookmarklet/simpread.js',
output : {
format : 'iife',
file : process.env.NODE_ENV === 'production' ? './dist/simpread.bookmarklet.min.js' : './dist/simpread.bookmarklet.js',
},
plugins,
}
]