-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
80 lines (76 loc) · 2.33 KB
/
gulpfile.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
70
71
72
73
74
75
76
77
78
79
80
'use strict';
var fs = require('fs');
var gulp = require('gulp');
var argv = require('yargs').argv;
var modRewrite = require('connect-modrewrite');
var options = {
PROJECT_PATH: __dirname,
pkg: require('./package.json'),
dt: new Date(),
banner: '/* <%= pkg.name %> v<%= pkg.version %>, <%= dt %> */\n',
bsOptions: {
port: argv.port || 80,
open: false,
notify: false,
server: {
middleware: [
modRewrite([
// ignore assets, etc
'^(/css/.*)$ $1 [L]',
'^(/fonts/.*)$ $1 [L]',
'^(/js/.*)$ $1 [L]',
'^(/node_modules/.*)$ $1 [L]',
// mocked app
'^/mocked(/node_modules/.*)$ $1 [L]',
'^/mocked/$ /index_mocked.html [L]',
'^/mocked/.*$ /index_mocked.html [L]',
// regular app
'^/.*$ /index.html [L]'
])
]
}
},
tsProject: {
noImplicitAny: false,
module: 'commonjs', //used instead of "system" to have lesser overhead for the dist minified version of app
target: 'ES5',
emitDecoratorMetadata: true,
experimentalDecorators: true,
moduleResolution: 'node'
},
paths: {
app: 'app',
dist: 'dist',
bootstrap: [
'node_modules/bootstrap-sass/assets/stylesheets/bootstrap/**'
],
html: [
'app/ts/**/*.html'
],
ts: [
'app/ts/**/*.ts',
'!app/ts/configs/**'
],
configs: ['app/ts/configs/**'],
distBundleSrc: 'app/js/bootstrap.js',
distBundleMockedSrc: 'app/js/bootstrap_mocked.js',
distLibs: [
'node_modules/reflect-metadata/Reflect.js',
'node_modules/zone.js/dist/zone.js'
],
appCss: 'app/css/**',
appIndex: 'app/index*.html',
distIndex: 'dist/index*.html',
tmp: '.tmp',
modulesSass: {src: ['app/ts/**/*.scss'], dest: 'app/sass/_modules.scss'}
}
};
fs.readdirSync('./zgulp').forEach(function(filename) {
if (filename.slice(-3) !== '.js') {
return;
}
require('./zgulp/' + filename)(options);
});
gulp.task('default', ['clean'], function() {
gulp.start('build');
});