-
Notifications
You must be signed in to change notification settings - Fork 13
/
rollup.config.js
44 lines (42 loc) · 1016 Bytes
/
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
import bo from '@angular-devkit/build-optimizer/src/build-optimizer/rollup-plugin';
import terser from 'rollup-plugin-terser';
import node_resolve from 'rollup-plugin-node-resolve-angular';
import visualizer from 'rollup-plugin-visualizer';
const isProduction = process.env.NODE_ENV === 'production';
if (isProduction) {
console.log('Production Build:');
}
export default {
input: './out-tsc/src/main.js',
output: {
dir: 'dist/rollup',
format: 'esm',
sourcemap: true
},
plugins: [
node_resolve({
es2015: true,
module: true,
jsnext: true,
main: true,
}),
bo({
sideEffectFreeModules: [
'@angular/core',
'@angular/common',
'rxjs'
]
}),
isProduction && terser.terser({
ecma: 6,
compress: {
pure_getters: true,
passes: 3,
global_defs: {
ngDevMode: false,
},
}
}),
isProduction && visualizer({sourcemap: true, filename: './dist/stats.html'}),
],
}