This is a bug report, related to performance. When building a project using Webpack (3.10.0, latest), and employing html-webpack-plugin (2.30.1) on an index.html file with no transformations, the incremental emit time of the project is increased by 10 seconds.
No error messages. Here is the performance data:

Note: Some variables are used in the config block below. Please see the minimal repro for the values of these variables.
{
watch: true,
watchOptions: {
poll: true,
},
resolve: {
extensions: [".ts", ".js"],
},
entry: {
app: path.join(clientPath, "main.ts"),
},
output: {
path: path.join(outputRootPath, "js"),
filename: "[name].build.js",
},
module: {
rules: [
{
test: /\.ts$/,
include: [ clientPath ],
loader: "@ngtools/webpack",
options: {
tsConfigPath: path.join(clientPath, "tsconfig.json"),
},
},
{
test: /\.scss$/,
include: [ clientPath ],
loaders: [ "raw-loader" ],
},
{
test: /\.html$/,
include: [ clientPath ],
loaders: [ "raw-loader" ],
},
],
},
plugins: [
// Fix for "Critical dependency: the request of a dependency is an expression"
// Ref: https://github.com/angular/angular/issues/11580#issuecomment-282705332
new webpack.ContextReplacementPlugin(
/(.+)?angular(\\|\/)core(.+)?/,
clientPath),
new HtmlWebpackPlugin({
filename: path.join(outputRootPath, "index.html"),
template: path.join(srcPath, "index.html"),
minify: false,
}),
],
}
Template file:
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<style>
#app .loading {
margin: 64px;
text-align: center;
}
</style>
<base href="/">
</head>
<body>
<div id="app">
<div class="loading">Loading...</div>
</div>
<script src="/js/app.build.js" defer></script>
</body>
</html>
(Worth noting: This repros even if I use: <!DOCTYPE html><html><head></head><body></body></html>)
slow-webpack-hwp.zipNode.js v6.11.3
win32 10.0.16299
NPM 3.10.10
[email protected]
[email protected]
Webpack 4.x shipped with many performance improvements. Is this issue still relevant?
This will improve alot because of https://github.com/jantimon/html-webpack-plugin/pull/972 for the next major release.
Released https://www.npmjs.com/package/html-webpack-plugin/v/4.0.0-alpha.2 with many performance improvements
Performance findings by different users for v4:
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.