-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathrollup.esm.config.js
More file actions
45 lines (39 loc) · 810 Bytes
/
Copy pathrollup.esm.config.js
File metadata and controls
45 lines (39 loc) · 810 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
import babel from 'rollup-plugin-babel';
import { terser } from 'rollup-plugin-terser';
import replace from 'rollup-plugin-replace';
let minifyEnv = process.env.minify || false;
const babelConf = {
babelrc: false,
presets: [
['@babel/preset-env', {
targets: {
esmodules: true
},
modules: false,
loose: false
}]
]
};
export default {
input: 'lindenmayer.js',
output: [
{
file: minifyEnv ? 'dist/lindenmayer.esm.min.js' : 'dist/lindenmayer.esm.js',
format: 'esm'
}
],
plugins: [
replace({
include: 'polyfills/**',
"__BUILD_FORMAT__": 'esm'
}),
babel(babelConf),
minifyEnv ? terser({
module: true,
mangle: {
reserved: ['LSystem'],
toplevel: true
},
}) : {}
],
};