forked from Nolanus/ngx-page-scroll
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make.js
47 lines (42 loc) · 1.17 KB
/
make.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
/* jshint node: true */
var pkg = require('./package.json');
var path = require('path');
var Builder = require('systemjs-builder');
var name = pkg.name;
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'),
'rxjs': path.resolve('node_modules/rxjs')
},
paths: {
'*': '*.js'
},
meta: {
'node_modules/@angular/*': {build: false},
'node_modules/rxjs/*': {build: false}
}
};
builder.config(config);
builder
.bundle(name, path.resolve(__dirname, 'bundles/', name + '.js'))
.then(function () {
var prodBuilder = new Builder();
prodBuilder.config(config);
prodBuilder
.bundle(name, path.resolve(__dirname, 'bundles/', name + '.min.js'), {
minify: true, sourceMaps: true
})
.then(function () {
console.log('Build complete.');
});
})
.catch(function (err) {
console.log('Error', err);
});