diff --git a/angular.json b/angular.json index 7f42c13..8855c83 100644 --- a/angular.json +++ b/angular.json @@ -119,8 +119,7 @@ "src/assets" ], "customWebpackConfig": { - "path": "./angular.webpack.js", - "target": "electron-renderer" + "path": "./angular.webpack.js" } } }, diff --git a/angular.webpack.js b/angular.webpack.js index 88cdcc7..698102b 100644 --- a/angular.webpack.js +++ b/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; } diff --git a/src/environments/environment.dev.ts b/src/environments/environment.dev.ts index 7953ebf..0c5b4ec 100644 --- a/src/environments/environment.dev.ts +++ b/src/environments/environment.dev.ts @@ -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' diff --git a/src/environments/environment.web.ts b/src/environments/environment.web.ts index 7953ebf..dceaa8a 100644 --- a/src/environments/environment.web.ts +++ b/src/environments/environment.web.ts @@ -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' };