Closed HiDeoo closed 6 years ago
Hi, thanks for the PR! I'll merge and release a new version in a few hours.
Hey @HiDeoo apologies for the spam, I tried to make this backward compatible, can you take a look please? I tested with webpack 3 but can't test 4 right now.
No problem, great call on keeping backward compatibility.
Doesn't work as-is with Webpack 4 so I made a little change to avoid running into issues like:
TypeError: Cannot read property '_runRegisterInterceptors' of undefined
Which is basically options = this._runRegisterInterceptors(options);
with this
used in the tap
method in the Hook
class.
It don't think this should impact Webpack 3.
The plugin works out-of-the-box with Webpack 4 but due to some changes in the Webpack plugin system, it causes some deprecation warning like:
According to the Webpack 4 migration guide for plugins/loaders:
This pull request changes the old
compiler.plugin
call to the newcompiler.hooks.done
syntax usingtap
. It also add a name to the function attached to the hook as it's now used by theProfilingPlugin
,ProgressPlugin
, etc.