-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for @angular-builders/custom-webpack Setup environment target based on env params Remove direct code changeing scripts postinstall/postinstall-web
- Loading branch information
Yuri Cherepanov
committed
Oct 29, 2019
1 parent
93d5a8c
commit c4b2cb6
Showing
6 changed files
with
71 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* Custom angular webpack configuration | ||
*/ | ||
|
||
module.exports = (config, options) => { | ||
config.target = 'electron-renderer'; | ||
if (options.customWebpackConfig.target) { | ||
config.target = options.customWebpackConfig.target; | ||
} else if (options.fileReplacements) { | ||
for(let fileReplacement of options.fileReplacements) { | ||
if (fileReplacement.replace !== 'src/environments/environment.ts') { | ||
continue; | ||
} | ||
|
||
let fileReplacementParts = fileReplacement['with'].split('.'); | ||
if (['dev', 'prod', 'test', 'electron-renderer'].indexOf(fileReplacementParts[1]) < 0) { | ||
config.target = fileReplacementParts[1]; | ||
} | ||
break; | ||
} | ||
} | ||
|
||
return config; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// The file contents for the current environment will overwrite these during build. | ||
// The build system defaults to the dev environment which uses `index.ts`, but if you do | ||
// `ng build --env=prod` then `index.prod.ts` will be used instead. | ||
// The list of which env maps to which file can be found in `.angular-cli.json`. | ||
|
||
export const AppConfig = { | ||
production: false, | ||
environment: 'DEV' | ||
}; |