chore: update angular and electron

This commit is contained in:
4gray authored and GitHub committed 2021-12-09 18:29:54 +00:00
1 parent 4aaed1cf98
commit b459bc1d15
5 files changed
+5854 -8384

No files matched your search

+19 -8
View File
@@ -1,24 +1,35 @@
//Polyfill Node.js core modules in Webpack. This module is only needed for webpack 5+.
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin');
/**
* 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 (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;
}
}
config.plugins = [
...config.plugins,
new NodePolyfillPlugin({
excludeAliases: ['console'],
}),
];
return config;
}
};