File tree 4 files changed +26
-20
lines changed
4 files changed +26
-20
lines changed Original file line number Diff line number Diff line change 7
7
"start" : " npm run watch" ,
8
8
"watch" : " webpack --watch --progress --profile" ,
9
9
"build" : " webpack --progress --profile" ,
10
+ "build:prod" : " NODE_ENV=\" production\" webpack --progress --profile" ,
10
11
"test" : " echo \" Error: no test specified\" && exit 1"
11
12
},
12
13
"repository" : {
55
56
"zone.js" : " ^0.8.5"
56
57
},
57
58
"devDependencies" : {
58
- "@types/requirejs " : " ^2.1.29 " ,
59
+ "@types/node " : " ^7.0.12 " ,
59
60
"to-string-loader" : " ^1.1.5"
60
61
}
61
62
}
Original file line number Diff line number Diff line change 1
- /// <reference path="../node_modules/@types/requirejs /index.d.ts" />
1
+ /// <reference path="../node_modules/@types/node /index.d.ts" />
2
2
3
- //import { enableProdMode } from '@angular/core';
3
+ // polyfills
4
4
import 'ts-helpers' ;
5
5
import 'reflect-metadata' ;
6
6
import 'core-js/client/shim' ;
7
- import 'zone.js' ;
7
+ import 'zone.js/dist/zone' ;
8
+
9
+ import { enableProdMode } from '@angular/core' ;
8
10
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic' ;
9
11
import AppModule from './app/app.module' ;
10
12
11
- // depending on the env mode, enable prod mode or add debugging modules
12
- // if (ENV.production === 'production') {
13
- // enableProdMode();
14
- // }
13
+ declare const ENV : {
14
+ production : boolean ;
15
+ } ;
15
16
16
- export function main ( ) {
17
- return platformBrowserDynamic ( ) . bootstrapModule ( AppModule ) ;
17
+ if ( ENV . production ) {
18
+ enableProdMode ( ) ;
19
+ } else {
20
+ Error [ 'stackTraceLimit' ] = Infinity ;
21
+ require ( 'zone.js/dist/long-stack-trace-zone' ) ;
18
22
}
19
23
20
- main ( ) ;
24
+ function deployApp ( ) {
25
+ return platformBrowserDynamic ( ) . bootstrapModule ( AppModule ) ;
26
+ }
21
27
22
- // if (document.readyState === 'complete ') {
23
- // main ();
24
- // } else {
25
- // document.addEventListener('DOMContentLoaded', main );
26
- // }
28
+ if ( document . readyState !== 'loading ') {
29
+ deployApp ( ) ;
30
+ } else {
31
+ document . addEventListener ( 'DOMContentLoaded' , deployApp ) ;
32
+ }
Original file line number Diff line number Diff line change 1
- const HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
2
1
const CopyWebpackPlugin = require ( 'copy-webpack-plugin' ) ;
3
2
const ExtractTextPlugin = require ( 'extract-text-webpack-plugin' ) ;
4
3
const CleanWebpackPlugin = require ( 'clean-webpack-plugin' ) ;
Original file line number Diff line number Diff line change 34
34
version "4.0.1"
35
35
resolved "https://registry.yarnpkg.com/@angular/router/-/router-4.0.1.tgz#2d73a4b6c40e18d5cd0bfd1f20222af64a11c11e"
36
36
37
- " @types/requirejs@^2.1.29 " :
38
- version "2.1.29 "
39
- resolved "https://registry.yarnpkg.com/@types/requirejs /-/requirejs-2.1.29 .tgz#bc48bc833c079c2c24ba6afbca6d3a03b3f4e2f3 "
37
+ " @types/node@^7.0.12 " :
38
+ version "7.0.12 "
39
+ resolved "https://registry.yarnpkg.com/@types/node /-/node-7.0.12 .tgz#ae5f67a19c15f752148004db07cbbb372e69efc9 "
40
40
41
41
abbrev@1 :
42
42
version "1.1.0"
You can’t perform that action at this time.
0 commit comments