Skip to content

Commit 6dc8ef6

Browse files
refactor(build): replace source in environments with environmentDefault entry
Replace source in environments with separate environmentDefault entry and updated docs to reflect this change BREAKING CHANGE: angular-cli.json has changed. A new environmentDefault entry replaces the previous source entry inside environments. To migrate the code follow the example below: Before: "environments": { "source": "environments/environment.ts", "dev": "environments/environment.ts", "prod": "environments/environment.prod.ts" } After: "environmentSource": "environments/environment.ts", "environments": { "dev": "environments/environment.ts", "prod": "environments/environment.prod.ts" } Closes angular#3857
1 parent cc8a53e commit 6dc8ef6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/angular-cli/blueprints/ng2/files/angular-cli.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
"styles.<%= styleExt %>"
2222
],
2323
"scripts": [],
24+
"environmentSource": "environments/environment.ts",
2425
"environments": {
25-
"source": "environments/environment.ts",
2626
"dev": "environments/environment.ts",
2727
"prod": "environments/environment.prod.ts"
2828
}

packages/angular-cli/models/webpack-build-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ const getWebpackTestConfig = function (projectRoot, environment, appConfig, test
128128
// This plugin is responsible for swapping the environment files.
129129
// Since it takes a RegExp as first parameter, we need to escape the path.
130130
// See https://webpack.github.io/docs/list-of-plugins.html#normalmodulereplacementplugin
131-
new RegExp(path.resolve(appRoot, appConfig.environments['source'])
131+
new RegExp(path.resolve(appRoot, appConfig['environmentSource'])
132132
.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&')),
133133
path.resolve(appRoot, appConfig.environments[environment])
134134
),

0 commit comments

Comments
 (0)