Skip to content

Commit 23b5d5e

Browse files
committed
feat(prod-build): add environment config
1 parent 2fac21b commit 23b5d5e

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const environment = {
2+
production: false
3+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const environment = {
2+
production: true
3+
};
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
import {bootstrap} from 'angular2/platform/browser';
2+
import {enableProdMode} from 'angular2/core';
3+
import {environment} from './app/environment';
24
import {<%= jsComponentName %>App} from './app/<%= htmlComponentName %>';
35

4-
bootstrap(<%= jsComponentName %>App, []);
6+
if (environment.production) { enableProdMode(); }
7+
8+
bootstrap(<%= jsComponentName %>App);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// The file for the current environment will overwrite this one during build
2+
// Different environments can be found in ../environments/
3+
// The build system defaults to the dev environment
4+
5+
export const environment = {
6+
production: false
7+
};

0 commit comments

Comments
 (0)