File tree Expand file tree Collapse file tree 4 files changed +26
-20
lines changed Expand file tree Collapse file tree 4 files changed +26
-20
lines changed Original file line number Diff line number Diff line change 77 "start" : " npm run watch" ,
88 "watch" : " webpack --watch --progress --profile" ,
99 "build" : " webpack --progress --profile" ,
10+ "build:prod" : " NODE_ENV=\" production\" webpack --progress --profile" ,
1011 "test" : " echo \" Error: no test specified\" && exit 1"
1112 },
1213 "repository" : {
5556 "zone.js" : " ^0.8.5"
5657 },
5758 "devDependencies" : {
58- "@types/requirejs " : " ^2.1.29 " ,
59+ "@types/node " : " ^7.0.12 " ,
5960 "to-string-loader" : " ^1.1.5"
6061 }
6162}
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" />
22
3- //import { enableProdMode } from '@angular/core';
3+ // polyfills
44import 'ts-helpers' ;
55import 'reflect-metadata' ;
66import 'core-js/client/shim' ;
7- import 'zone.js' ;
7+ import 'zone.js/dist/zone' ;
8+
9+ import { enableProdMode } from '@angular/core' ;
810import { platformBrowserDynamic } from '@angular/platform-browser-dynamic' ;
911import AppModule from './app/app.module' ;
1012
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+ } ;
1516
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' ) ;
1822}
1923
20- main ( ) ;
24+ function deployApp ( ) {
25+ return platformBrowserDynamic ( ) . bootstrapModule ( AppModule ) ;
26+ }
2127
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' ) ;
21const CopyWebpackPlugin = require ( 'copy-webpack-plugin' ) ;
32const ExtractTextPlugin = require ( 'extract-text-webpack-plugin' ) ;
43const CleanWebpackPlugin = require ( 'clean-webpack-plugin' ) ;
Original file line number Diff line number Diff line change 3434 version "4.0.1"
3535 resolved "https://registry.yarnpkg.com/@angular/router/-/router-4.0.1.tgz#2d73a4b6c40e18d5cd0bfd1f20222af64a11c11e"
3636
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 "
4040
4141abbrev@1 :
4242 version "1.1.0"
You can’t perform that action at this time.
0 commit comments