Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
? {
html5: true,
collapseWhitespace: true,
preserveLineBreaks: false,
minifyCSS: true,
minifyJS: true,
removeComments: false
}
: false
}));
// Inline 生成出来的css
if (_inlineCSS) {
let pageName = path.normalize(entry).split(path.sep).pop();
if (pageName) {
cssInlinePlugins.push(new HTMLInlineCSSWebpackPlugin({
filter(fileName) {
let cssFileName = fileName;
if (/\.css$/.test(fileName)) {
// file的hash默认是8个,如果另外定义数量请注意修改这里的截取位置(MiniCssExtractPlugin中)
cssFileName = fileName.slice(0, fileName.length - 13);
}
return (pageName === cssFileName) || new RegExp(`${pageName}\.html$`).test(fileName);
}
}));
}
}
});