-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsspaCustomWebpackConfigTemplate.js
More file actions
28 lines (22 loc) · 1.11 KB
/
sspaCustomWebpackConfigTemplate.js
File metadata and controls
28 lines (22 loc) · 1.11 KB
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
const sspaCustomWebpackTemplate = `
const singleSpaAngularWebpack = require('single-spa-angular/lib/webpack').default;
module.exports = (config, options) => {
//removeMiniCssExtract - required to create css files separately otherwise css is moved to js by default by the sspa
const singleSpaWebpackConfig = singleSpaAngularWebpack(config, options, {removeMiniCssExtract: false});
//separate css and js content separately. Remove css from main file
singleSpaWebpackConfig.entry.styles = singleSpaWebpackConfig.entry.main;
var mainjs = singleSpaWebpackConfig.entry.main;
singleSpaWebpackConfig.entry.main = mainjs.filter(e => !e.endsWith('.css'));
//separate css and js content separately. Remove ts from styles file
var stylescss = singleSpaWebpackConfig.entry.styles;
singleSpaWebpackConfig.entry.styles = stylescss.filter(e => !e.endsWith('.ts'));
delete singleSpaWebpackConfig.output.chunkLoadingGlobal;
return singleSpaWebpackConfig;
};
`;
const getSSPACustomWebpackTemplate = () => {
return sspaCustomWebpackTemplate;
};
module.exports = {
getSSPACustomWebpackTemplate
};