-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
70 lines (61 loc) · 1.74 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// import angular from 'rollup-plugin-angular';
import commonjs from 'rollup-plugin-commonjs';
import html from 'rollup-plugin-html';
import nodeResolve from 'rollup-plugin-node-resolve';
import typescript from 'rollup-plugin-typescript';
import uglify from 'rollup-plugin-uglify';
export default {
entry: 'dist/index.js',
dest: 'dist/bundle.umd.js',
exports: 'named',
sourceMap: false,
format: 'umd',
moduleName: '@ngx-core/common',
onwarn,
plugins: [
// angular(),
commonjs({
namedExports: {
'node_modules/rxjs/**': ['named']
}
}),
html({
include: '**/*.html',
htmlMinifierOptions: {
caseSensitive: true // need to do not lower letter
}
}),
nodeResolve({
// use "es2015" field for ES2015 modules with ES2015 code,
// if possible
es2015: true, // Default: false
// use "module" field for ES2015 modules with ES5 code,
// if possible
module: true, // Default: true
// use "jsnext:main" if possible
// – see https://github.com/rollup/rollup/wiki/jsnext:main
jsnext: true, // Default: false
// use "main" field or index.js, even if it's not an ES6 module
// (needs to be converted from CommonJS to ES6
// – see https://github.com/rollup/rollup-plugin-commonjs
main: true, // Default: true
extensions: [ '.js', '.json', 'html']
}),
typescript({
typescript: require('./node_modules/typescript')
}),
uglify()
],
globals: {
'@angular/core': 'ng.core'
}
};
function onwarn(message) {
const suppressed = [
'UNRESOLVED_IMPORT',
'THIS_IS_UNDEFINED'
];
if (!suppressed.find(code => message.code === code)) {
return console.warn(message.message);
}
}