forked from antonybudianto/angular-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulp.config.js
More file actions
117 lines (110 loc) · 3 KB
/
gulp.config.js
File metadata and controls
117 lines (110 loc) · 3 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
var envConfig = require('./gulp.env');
module.exports = function () {
var root = '',
src = root + 'src/',
app = src + 'app/',
test = src + 'test/',
tmp = src + 'tmp/',
tmpApp = tmp + 'app/',
tmpTest = tmp + 'test/',
testHelper = test + 'test-helpers/',
e2e = test + 'e2e/',
tmpE2E = tmpTest + 'e2e/',
assets = src + 'assets/',
assetsPath = {
styles: assets + 'styles/',
images: assets + 'images/',
fonts: assets + 'fonts/'
},
index = src + 'index.html',
tsFiles = [
app + '**/!(*.spec)+(.ts)'
],
tsTestFiles = {
unit: [app + '**/*.spec.ts'],
e2e: [e2e + '**/*.ts'],
helper: [testHelper + '**/*.ts']
},
build = {
path: 'build/',
app: 'build/app/',
fonts: 'build/fonts',
assetPath: 'build/assets/',
assets: {
lib: {
js: 'lib.js',
css: 'lib.css'
}
}
},
report = {
path: 'report/'
};
var e2eConfig = {
seleniumTarget: 'http://127.0.0.1:3000'
};
var systemJs = {
builder: {
normalize: true,
minify: true,
mangle: true,
runtime: false,
globalDefs: { DEBUG: false, ENV: 'production' }
}
};
var config = {
root: root,
src: src,
app: app,
test: test,
tmp: tmp,
tmpApp: tmpApp,
tmpTest: tmpTest,
tmpE2E: tmpE2E,
testHelper: testHelper,
e2e: e2e,
e2eConfig: e2eConfig,
assets: assets,
index: index,
build: build,
report: report,
assetsPath: assetsPath,
tsFiles: tsFiles,
tsTestFiles: tsTestFiles,
systemJs: systemJs
};
if (envConfig.ENV === envConfig.ENVS.DEV)
{
var historyApiFallback = require('connect-history-api-fallback');
var browserSync = {
dev: {
port: 3000,
server: {
baseDir: './src/',
middleware: [historyApiFallback()],
routes: {
"/node_modules": "node_modules",
"/src": "src"
}
},
files: [
src + "index.html",
src + "systemjs.conf.js",
assetsPath.styles + "main.css",
tmpApp + "**/*.js",
app + "**/*.css",
app + "**/*.html"
]
},
prod: {
port: 3001,
server: {
baseDir: './' + build.path,
middleware: [historyApiFallback()]
}
}
};
config.browserSync = browserSync;
}
return config;
};