forked from vladotesanovic/ngSemantic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
library.builder.js
44 lines (40 loc) · 1.13 KB
/
library.builder.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
var path = require('path');
var Builder = require('systemjs-builder');
var bundleName = name = "ng-semantic";
var builder = new Builder();
var config = {
baseURL: '.',
transpiler: 'typescript',
typescriptOptions: {
module: 'cjs'
},
map: {
"typescript": './node_modules/typescript/lib/typescript.js',
"@angular": path.resolve('node_modules/@angular')
},
paths: {
'*': '*.js'
},
meta: {
'node_modules/@angular/*': { build: false }
}
};
builder.config(config);
// development
builder
.bundle(bundleName, path.resolve(__dirname, 'bundles/', name + '.js'), { minify: false, mangle: false, rollup: false, sourceMaps: true })
.then(function() {
console.log('Build complete.');
})
.catch(function(err) {
console.log('Error', err);
});
// production
builder
.bundle(bundleName, path.resolve(__dirname, 'bundles/', name + '.min.js'), { minify: true, mangle: true, rollup: true, sourceMaps: false })
.then(function() {
console.log('Minified build complete.');
})
.catch(function(err) {
console.log('Error', err);
});