ref/ clean custom webpack target ('electron-renderer' or 'web')
This commit is contained in:
@@ -119,8 +119,7 @@
|
|||||||
"src/assets"
|
"src/assets"
|
||||||
],
|
],
|
||||||
"customWebpackConfig": {
|
"customWebpackConfig": {
|
||||||
"path": "./angular.webpack.js",
|
"path": "./angular.webpack.js"
|
||||||
"target": "electron-renderer"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,17 +4,17 @@
|
|||||||
|
|
||||||
module.exports = (config, options) => {
|
module.exports = (config, options) => {
|
||||||
config.target = 'electron-renderer';
|
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) {
|
for(let fileReplacement of options.fileReplacements) {
|
||||||
if (fileReplacement.replace !== 'src/environments/environment.ts') {
|
if (fileReplacement.replace !== 'src/environments/environment.ts') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
let fileReplacementParts = fileReplacement['with'].split('.');
|
let fileReplacementParts = fileReplacement['with'].split('.');
|
||||||
if (['dev', 'prod', 'test', 'electron-renderer'].indexOf(fileReplacementParts[1]) < 0) {
|
if (fileReplacementParts.length > 1 && ['web'].indexOf(fileReplacementParts[1]) >= 0) {
|
||||||
config.target = fileReplacementParts[1];
|
config.target = 'web';
|
||||||
}
|
}
|
||||||
break;
|
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 = {
|
export const AppConfig = {
|
||||||
production: false,
|
production: false,
|
||||||
environment: 'DEV'
|
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 = {
|
export const AppConfig = {
|
||||||
production: false,
|
production: false,
|
||||||
environment: 'DEV'
|
environment: 'WEB'
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user