ref/ clean custom webpack target ('electron-renderer' or 'web')
This commit is contained in:
@@ -119,8 +119,7 @@
|
||||
"src/assets"
|
||||
],
|
||||
"customWebpackConfig": {
|
||||
"path": "./angular.webpack.js",
|
||||
"target": "electron-renderer"
|
||||
"path": "./angular.webpack.js"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -4,17 +4,17 @@
|
||||
|
||||
module.exports = (config, options) => {
|
||||
config.target = 'electron-renderer';
|
||||
if (options.customWebpackConfig.target) {
|
||||
config.target = options.customWebpackConfig.target;
|
||||
} else if (options.fileReplacements) {
|
||||
|
||||
|
||||
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];
|
||||
if (fileReplacementParts.length > 1 && ['web'].indexOf(fileReplacementParts[1]) >= 0) {
|
||||
config.target = 'web';
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
// 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'
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
// 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'
|
||||
environment: 'WEB'
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user