-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathrollup.browser.config.js
67 lines (59 loc) · 1.54 KB
/
rollup.browser.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import babel from 'rollup-plugin-babel';
// import commonjs from 'rollup-plugin-commonjs';
// import resolve from 'rollup-plugin-node-resolve';
import { terser } from 'rollup-plugin-terser';
import replace from 'rollup-plugin-replace';
let minifyEnv = process.env.minify || false;
let output = [
{
file: minifyEnv ? 'dist/lindenmayer.browser.min.js' : 'dist/lindenmayer.browser.js',
name: 'LSystem',
format: 'umd'
}
];
const babelConf = {
babelrc: false,
// https://github.com/rollup/rollup-plugin-babel/issues/254#issuecomment-423799147
// exclude: [/\/core-js\//],
plugins: [
["@babel/plugin-transform-for-of", {"assumeArray": true}]
],
presets: [
['@babel/preset-env', {
targets: {
ie: '11'
},
// useBuiltIns: 'entry',
// corejs: {version: 3},
modules: false,
loose: true
}]
],
};
export default {
input: 'lindenmayer.js',
output,
plugins: [
replace({
include: 'polyfills/**',
"__BUILD_FORMAT__": 'browser'
}),
// resolve({
// // only: [ 'core-js' ]
// }),
// commonjs({
// // non-CommonJS modules will be ignored, but you can also
// // specifically include/exclude files
// include: 'node_modules/**', // Default: undefined
// // if false then skip sourceMap generation for CommonJS modules
// sourceMap: false, // Default: true
// }),
babel(babelConf),
minifyEnv ? terser({
ecma: '5',
mangle: {
reserved: ['LSystem'],
toplevel: true
},
}) : {} ],
};