Skip to content

Webpack v3 support #74

@etripier

Description

@etripier

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions