forked from steveblue/angular2-rollup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
40 lines (37 loc) · 976 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
// rollup.config.js
import replace from 'rollup-plugin-replace';
import resolve from 'rollup-plugin-node-resolve';
import cleanup from 'rollup-plugin-cleanup';
import commonjs from 'rollup-plugin-commonjs';
const config = require('./ngr.config.js');
export default {
entry: './main.prod.js',
format: 'iife',
dest: config.build + '/bundle.es2015.js',
sourceMap: false,
treeshake: true,
plugins: [
replace({ 'ENVIRONMENT': JSON.stringify('production') }),
commonjs({
include: 'node_modules/rxjs/**'
}),
resolve({
es2015: true,
module: true,
jsnext: true,
main: true,
extensions: ['.js', '.json'],
preferBuiltins: false
}),
cleanup()
],
onwarn: function (message) {
if (/at the top level of an ES module, and has been rewritten/.test(message)) {
return;
}
if(/The final argument to magicString.overwrite/.test(message)) {
return;
}
console.error(message);
}
}