Html-webpack-plugin: Incompatibility with speed-measure-webpack-plugin

Created on 25 Oct 2018  路  7Comments  路  Source: jantimon/html-webpack-plugin

Expected behavior

I would like to be able to continue using speed-measure-webpack-plugin to monitor build timings with the latest beta version of html-webpack-plugin.

Current behavior

The changes to reuse a single child compiler (#967) are awesome but unfortunately introduce an incompatibility with the way that speed-measure-webpack-plugin works. speed-measure-webpack-plugin uses a Proxy to wrap the compiler object which results in multiple child compilers being created by html-webpack-plugin (one for the original compiler and another for the wrapped one). This causes the following error because the templates are only set on one of the child compilers.

ERROR in   TypeError: Cannot read property 'hash' of undefined

  - compiler.js:292 childCompiler.compileTemplates.then
    [html-speed-measure-webpack-plugin-bug-repro]/[html-webpack-plugin]/lib/compiler.js:292:30

Happy to help fix but not sure which plugin is really at fault here.

Environment

Node.js v8.11.1
darwin 17.7.0
npm 5.6.0
webpack 4.23.0
html-webpack-plugin 4.0.0-beta.2

Config

Reproduction repo

All 7 comments

Any updates about this? Really want to track down why the build time of my project is taking 18 minutes (!) long :)

I guess nobody is working on it.
Could you please grab a debugger and find out why the wrapped compiler has no hash?

remove speed-measure-webpack-plugin

I meet the same error and compiler failed and i remove speed-measure-webpack that can compiler success. It seems that two plugin has compatible problem.

Didn't solve this problem?

I'll close this for now as nobody seems to work on this issue and https://github.com/jantimon/cpuprofile-webpack-plugin can provide more accurate speed measurements.

Was this page helpful?
0 / 5 - 0 ratings