@@ -115,7 +115,9 @@ export class SeedConfig {
115
115
* `hot_loader_main.ts` file will be used.
116
116
* @type {string }
117
117
*/
118
- BOOTSTRAP_MODULE = `${ this . BOOTSTRAP_DIR } /` + ( this . ENABLE_HOT_LOADING ? 'hot_loader_main' : 'main' ) ;
118
+ get BOOTSTRAP_MODULE ( ) {
119
+ return `${ this . BOOTSTRAP_DIR } /` + ( this . ENABLE_HOT_LOADING ? 'hot_loader_main' : 'main' ) ;
120
+ }
119
121
120
122
/**
121
123
* The default title of the application as used in the `<title>` tag of the
@@ -128,19 +130,25 @@ export class SeedConfig {
128
130
* The base folder of the applications source files.
129
131
* @type {string }
130
132
*/
131
- APP_SRC = `src/${ this . APP_CLIENT } ` ;
133
+ get APP_SRC ( ) {
134
+ return `src/${ this . APP_CLIENT } ` ;
135
+ }
132
136
133
137
/**
134
138
* The folder of the applications asset files.
135
139
* @type {string }
136
140
*/
137
- ASSETS_SRC = `${ this . APP_SRC } /assets` ;
141
+ get ASSETS_SRC ( ) {
142
+ return `${ this . APP_SRC } /assets` ;
143
+ }
138
144
139
145
/**
140
146
* The folder of the applications css files.
141
147
* @type {string }
142
148
*/
143
- CSS_SRC = `${ this . APP_SRC } /css` ;
149
+ get CSS_SRC ( ) {
150
+ return `${ this . APP_SRC } /css` ;
151
+ }
144
152
145
153
/**
146
154
* The directory of the applications tools
@@ -151,7 +159,9 @@ export class SeedConfig {
151
159
/**
152
160
* The directory of the tasks provided by the seed.
153
161
*/
154
- SEED_TASKS_DIR = join ( process . cwd ( ) , this . TOOLS_DIR , 'tasks' , 'seed' ) ;
162
+ get SEED_TASKS_DIR ( ) {
163
+ return join ( process . cwd ( ) , this . TOOLS_DIR , 'tasks' , 'seed' ) ;
164
+ }
155
165
156
166
/**
157
167
* The destination folder for the generated documentation.
@@ -169,42 +179,56 @@ export class SeedConfig {
169
179
* The folder for built files in the `dev` environment.
170
180
* @type {string }
171
181
*/
172
- DEV_DEST = `${ this . DIST_DIR } /dev` ;
182
+ get DEV_DEST ( ) {
183
+ return `${ this . DIST_DIR } /dev` ;
184
+ }
173
185
174
186
/**
175
187
* The folder for the built files in the `prod` environment.
176
188
* @type {string }
177
189
*/
178
- PROD_DEST = `${ this . DIST_DIR } /prod` ;
190
+ get PROD_DEST ( ) {
191
+ return `${ this . DIST_DIR } /prod` ;
192
+ }
179
193
180
194
/**
181
195
* The folder for temporary files.
182
196
* @type {string }
183
197
*/
184
- TMP_DIR = `${ this . DIST_DIR } /tmp` ;
198
+ get TMP_DIR ( ) {
199
+ return `${ this . DIST_DIR } /tmp` ;
200
+ }
185
201
186
202
/**
187
203
* The folder for the built files, corresponding to the current environment.
188
204
* @type {string }
189
205
*/
190
- APP_DEST = this . ENV === ENVIRONMENTS . DEVELOPMENT ? this . DEV_DEST : this . PROD_DEST ;
206
+ get APP_DEST ( ) {
207
+ return this . ENV === ENVIRONMENTS . DEVELOPMENT ? this . DEV_DEST : this . PROD_DEST ;
208
+ }
191
209
192
210
/**
193
211
* The folder for the built CSS files.
194
212
* @type {strings }
195
213
*/
196
- CSS_DEST = `${ this . APP_DEST } /css` ;
214
+ get CSS_DEST ( ) {
215
+ return `${ this . APP_DEST } /css` ;
216
+ }
197
217
198
218
/**
199
219
* The folder for the built JavaScript files.
200
220
* @type {string }
201
221
*/
202
- JS_DEST = `${ this . APP_DEST } /js` ;
222
+ get JS_DEST ( ) {
223
+ return `${ this . APP_DEST } /js` ;
224
+ }
203
225
204
226
/**
205
227
* The version of the application as defined in the `package.json`.
206
228
*/
207
- VERSION = appVersion ( ) ;
229
+ get VERSION ( ) {
230
+ return appVersion ( ) ;
231
+ }
208
232
209
233
/**
210
234
* The name of the bundle file to includes all CSS files.
@@ -252,21 +276,25 @@ export class SeedConfig {
252
276
* The list of NPM dependcies to be injected in the `index.html`.
253
277
* @type {InjectableDependency[] }
254
278
*/
255
- NPM_DEPENDENCIES : InjectableDependency [ ] = [
256
- { src : 'systemjs/dist/system-polyfills.src.js' , inject : 'shims' , env : ENVIRONMENTS . DEVELOPMENT } ,
257
- { src : 'zone.js/dist/zone.js' , inject : 'libs' } ,
258
- { src : 'core-js/client/shim.min.js' , inject : 'shims' } ,
259
- { src : 'systemjs/dist/system.src.js' , inject : 'shims' , env : ENVIRONMENTS . DEVELOPMENT } ,
260
- { src : 'rxjs/bundles/Rx.js' , inject : 'libs' , env : ENVIRONMENTS . DEVELOPMENT }
261
- ] ;
279
+ get NPM_DEPENDENCIES ( ) : InjectableDependency [ ] {
280
+ return [
281
+ { src : 'systemjs/dist/system-polyfills.src.js' , inject : 'shims' , env : ENVIRONMENTS . DEVELOPMENT } ,
282
+ { src : 'zone.js/dist/zone.js' , inject : 'libs' } ,
283
+ { src : 'core-js/client/shim.min.js' , inject : 'shims' } ,
284
+ { src : 'systemjs/dist/system.src.js' , inject : 'shims' , env : ENVIRONMENTS . DEVELOPMENT } ,
285
+ { src : 'rxjs/bundles/Rx.js' , inject : 'libs' , env : ENVIRONMENTS . DEVELOPMENT }
286
+ ] ;
287
+ }
262
288
263
289
/**
264
290
* The list of local files to be injected in the `index.html`.
265
291
* @type {InjectableDependency[] }
266
292
*/
267
- APP_ASSETS : InjectableDependency [ ] = [
268
- { src : `${ this . CSS_SRC } /main.${ this . getInjectableStyleExtension ( ) } ` , inject : true , vendor : false } ,
269
- ] ;
293
+ get APP_ASSETS ( ) : InjectableDependency [ ] {
294
+ return [
295
+ { src : `${ this . CSS_SRC } /main.${ this . getInjectableStyleExtension ( ) } ` , inject : true , vendor : false } ,
296
+ ] ;
297
+ }
270
298
271
299
/**
272
300
* The list of editor temporary files to ignore in watcher and asset builder.
@@ -290,86 +318,92 @@ export class SeedConfig {
290
318
* The configuration of SystemJS for the `dev` environment.
291
319
* @type {any }
292
320
*/
293
- protected SYSTEM_CONFIG_DEV : any = {
294
- defaultJSExtensions : true ,
295
- packageConfigPaths : [
296
- `${ this . APP_BASE } node_modules/*/package.json` ,
297
- `${ this . APP_BASE } node_modules/**/package.json` ,
298
- `${ this . APP_BASE } node_modules/@angular/*/package.json`
299
- ] ,
300
- paths : {
301
- [ this . BOOTSTRAP_MODULE ] : `${ this . APP_BASE } ${ this . BOOTSTRAP_MODULE } ` ,
302
- '@angular/core' : `${ this . APP_BASE } node_modules/@angular/core/core.umd.js` ,
303
- '@angular/common' : `${ this . APP_BASE } node_modules/@angular/common/common.umd.js` ,
304
- '@angular/compiler' : `${ this . APP_BASE } node_modules/@angular/compiler/compiler.umd.js` ,
305
- '@angular/http' : `${ this . APP_BASE } node_modules/@angular/http/http.umd.js` ,
306
- '@angular/router' : `${ this . APP_BASE } node_modules/@angular/router/router.umd.js` ,
307
- '@angular/platform-browser' : `${ this . APP_BASE } node_modules/@angular/platform-browser/platform-browser.umd.js` ,
308
- '@angular/platform-browser-dynamic' : `${ this . APP_BASE } node_modules/@angular/platform-browser-dynamic/platform-browser-dynamic.umd.js` ,
309
- 'rxjs/*' : `${ this . APP_BASE } node_modules/rxjs/*` ,
310
- 'app/*' : `/app/*` ,
311
- '*' : `${ this . APP_BASE } node_modules/*`
312
- } ,
313
- packages : {
314
- rxjs : { defaultExtension : false }
315
- }
316
- } ;
321
+ protected get SYSTEM_CONFIG_DEV ( ) : any {
322
+ return {
323
+ defaultJSExtensions : true ,
324
+ packageConfigPaths : [
325
+ `${ this . APP_BASE } node_modules/*/package.json` ,
326
+ `${ this . APP_BASE } node_modules/**/package.json` ,
327
+ `${ this . APP_BASE } node_modules/@angular/*/package.json`
328
+ ] ,
329
+ paths : {
330
+ [ this . BOOTSTRAP_MODULE ] : `${ this . APP_BASE } ${ this . BOOTSTRAP_MODULE } ` ,
331
+ '@angular/core' : `${ this . APP_BASE } node_modules/@angular/core/core.umd.js` ,
332
+ '@angular/common' : `${ this . APP_BASE } node_modules/@angular/common/common.umd.js` ,
333
+ '@angular/compiler' : `${ this . APP_BASE } node_modules/@angular/compiler/compiler.umd.js` ,
334
+ '@angular/http' : `${ this . APP_BASE } node_modules/@angular/http/http.umd.js` ,
335
+ '@angular/router' : `${ this . APP_BASE } node_modules/@angular/router/router.umd.js` ,
336
+ '@angular/platform-browser' : `${ this . APP_BASE } node_modules/@angular/platform-browser/platform-browser.umd.js` ,
337
+ '@angular/platform-browser-dynamic' : `${ this . APP_BASE } node_modules/@angular/platform-browser-dynamic/platform-browser-dynamic.umd.js` ,
338
+ 'rxjs/*' : `${ this . APP_BASE } node_modules/rxjs/*` ,
339
+ 'app/*' : `/app/*` ,
340
+ '*' : `${ this . APP_BASE } node_modules/*`
341
+ } ,
342
+ packages : {
343
+ rxjs : { defaultExtension : false }
344
+ }
345
+ } ;
346
+ }
317
347
318
348
/**
319
349
* The configuration of SystemJS of the application.
320
350
* Per default, the configuration of the `dev` environment will be used.
321
351
* @type {any }
322
352
*/
323
- SYSTEM_CONFIG : any = this . SYSTEM_CONFIG_DEV ;
353
+ get SYSTEM_CONFIG ( ) : any {
354
+ return this . SYSTEM_CONFIG_DEV ;
355
+ }
324
356
325
357
/**
326
358
* The system builder configuration of the application.
327
359
* @type {any }
328
360
*/
329
- SYSTEM_BUILDER_CONFIG : any = {
330
- defaultJSExtensions : true ,
331
- packageConfigPaths : [
332
- join ( this . PROJECT_ROOT , 'node_modules' , '*' , 'package.json' ) ,
333
- join ( this . PROJECT_ROOT , 'node_modules' , '@angular' , '*' , 'package.json' )
334
- ] ,
335
- paths : {
336
- [ `${ this . TMP_DIR } /*` ] : `${ this . TMP_DIR } /*` ,
337
- '*' : 'node_modules/*'
338
- } ,
339
- packages : {
340
- '@angular/core' : {
341
- main : 'index.js' ,
342
- defaultExtension : 'js'
343
- } ,
344
- '@angular/compiler' : {
345
- main : 'index.js' ,
346
- defaultExtension : 'js'
347
- } ,
348
- '@angular/common' : {
349
- main : 'index.js' ,
350
- defaultExtension : 'js'
351
- } ,
352
- '@angular/http' : {
353
- main : 'index.js' ,
354
- defaultExtension : 'js'
361
+ get SYSTEM_BUILDER_CONFIG ( ) : any {
362
+ return {
363
+ defaultJSExtensions : true ,
364
+ packageConfigPaths : [
365
+ join ( this . PROJECT_ROOT , 'node_modules' , '*' , 'package.json' ) ,
366
+ join ( this . PROJECT_ROOT , 'node_modules' , '@angular' , '*' , 'package.json' )
367
+ ] ,
368
+ paths : {
369
+ [ `${ this . TMP_DIR } /*` ] : `${ this . TMP_DIR } /*` ,
370
+ '*' : 'node_modules/*'
355
371
} ,
356
- '@angular/platform-browser' : {
357
- main : 'index.js' ,
358
- defaultExtension : 'js'
359
- } ,
360
- '@angular/platform-browser-dynamic' : {
361
- main : 'index.js' ,
362
- defaultExtension : 'js'
363
- } ,
364
- '@angular/router' : {
365
- main : 'index.js' ,
366
- defaultExtension : 'js'
367
- } ,
368
- 'rxjs' : {
369
- defaultExtension : 'js'
372
+ packages : {
373
+ '@angular/core' : {
374
+ main : 'index.js' ,
375
+ defaultExtension : 'js'
376
+ } ,
377
+ '@angular/compiler' : {
378
+ main : 'index.js' ,
379
+ defaultExtension : 'js'
380
+ } ,
381
+ '@angular/common' : {
382
+ main : 'index.js' ,
383
+ defaultExtension : 'js'
384
+ } ,
385
+ '@angular/http' : {
386
+ main : 'index.js' ,
387
+ defaultExtension : 'js'
388
+ } ,
389
+ '@angular/platform-browser' : {
390
+ main : 'index.js' ,
391
+ defaultExtension : 'js'
392
+ } ,
393
+ '@angular/platform-browser-dynamic' : {
394
+ main : 'index.js' ,
395
+ defaultExtension : 'js'
396
+ } ,
397
+ '@angular/router' : {
398
+ main : 'index.js' ,
399
+ defaultExtension : 'js'
400
+ } ,
401
+ 'rxjs' : {
402
+ defaultExtension : 'js'
403
+ }
370
404
}
371
- }
372
- } ;
405
+ } ;
406
+ }
373
407
374
408
/**
375
409
* The Autoprefixer configuration for the application.
@@ -391,30 +425,32 @@ export class SeedConfig {
391
425
* Configurations for NPM module configurations. Add to or override in project.config.ts.
392
426
* If you like, use the mergeObject() method to assist with this.
393
427
*/
394
- PLUGIN_CONFIGS : any = {
395
- /**
396
- * The BrowserSync configuration of the application.
397
- * The default open behavior is to open the browser. To prevent the browser from opening use the `--b` flag when
398
- * running `npm start` (tested with serve.dev).
399
- * Example: `npm start -- --b`
400
- * @type {any }
401
- */
402
- 'browser-sync' : {
403
- middleware : [ require ( 'connect-history-api-fallback' ) ( { index : `${ this . APP_BASE } index.html` } ) ] ,
404
- port : this . PORT ,
405
- startPath : this . APP_BASE ,
406
- open : argv [ 'b' ] ? false : true ,
407
- injectChanges : false ,
408
- server : {
409
- baseDir : `${ this . DIST_DIR } /empty/` ,
410
- routes : {
411
- [ `${ this . APP_BASE } ${ this . APP_DEST } ` ] : this . APP_DEST ,
412
- [ `${ this . APP_BASE } node_modules` ] : 'node_modules' ,
413
- [ `${ this . APP_BASE . replace ( / \/ $ / , '' ) } ` ] : this . APP_DEST
428
+ get PLUGIN_CONFIGS ( ) : any {
429
+ return {
430
+ /**
431
+ * The BrowserSync configuration of the application.
432
+ * The default open behavior is to open the browser. To prevent the browser from opening use the `--b` flag when
433
+ * running `npm start` (tested with serve.dev).
434
+ * Example: `npm start -- --b`
435
+ * @type {any }
436
+ */
437
+ 'browser-sync' : {
438
+ middleware : [ require ( 'connect-history-api-fallback' ) ( { index : `${ this . APP_BASE } index.html` } ) ] ,
439
+ port : this . PORT ,
440
+ startPath : this . APP_BASE ,
441
+ open : argv [ 'b' ] ? false : true ,
442
+ injectChanges : false ,
443
+ server : {
444
+ baseDir : `${ this . DIST_DIR } /empty/` ,
445
+ routes : {
446
+ [ `${ this . APP_BASE } ${ this . APP_DEST } ` ] : this . APP_DEST ,
447
+ [ `${ this . APP_BASE } node_modules` ] : 'node_modules' ,
448
+ [ `${ this . APP_BASE . replace ( / \/ $ / , '' ) } ` ] : this . APP_DEST
449
+ }
414
450
}
415
451
}
416
- }
417
- } ;
452
+ } ;
453
+ }
418
454
419
455
/**
420
456
* Recursively merge source onto target.
0 commit comments