-
-
Notifications
You must be signed in to change notification settings - Fork 167
Webpack v3 support #74
Description
First off: I'm a huge fan of the plugin and Terser in general. It's always nice when things run faster and produce better results.
Feature Proposal
I know the issue title is probably going to elicit some groans, but it doesn't seem like much is preventing this plugin from working on Webpack v3. I think it might just involve modifying the index file like so:
if (compiler.hooks) {
...
} else {
compiler.plugin('compilation', (compilation) => {
if (this.options.sourceMap) {
compilation.plugin('build-module', buildModuleFn);
}
compilation.plugin('optimize-chunk-assets', optimizeFn.bind(this, compilation));
});
}We'd lose out on the contenthash regeneration, but I don't think that's breaking for Webpack v3 users (or at least, we're used to the problem).
For those of us stuck with older versions of Webpack, this would significantly improve our build times and give us a sample of the benefits of v4!
I'd be happy to open a PR to make the needed changes if the idea seems appealing.
Feature Use Case
This would be very helpful for developers stuck in the year 2016.