-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathangular.webpack.js
More file actions
29 lines (24 loc) · 899 Bytes
/
angular.webpack.js
File metadata and controls
29 lines (24 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
* Custom angular webpack configuration
*/
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
module.exports = (config, options) => {
config.target = 'electron-renderer';
if (options.fileReplacements) {
for(let fileReplacement of options.fileReplacements) {
if (fileReplacement.replace !== 'src/environments/environment.ts') {
continue;
}
let fileReplacementParts = fileReplacement['with'].split('.');
if (fileReplacementParts.length > 1 && ['web'].indexOf(fileReplacementParts[1]) >= 0) {
config.target = 'web';
}
break;
}
}
config.plugins.push(new MonacoWebpackPlugin({
languages: ['css', 'html', 'javascript', 'sql', 'typescript', 'groovy'],
features: ['contextmenu', 'clipboard', 'find'],
}));
return config;
}