Skip to content
This repository was archived by the owner on Nov 20, 2020. It is now read-only.
This repository was archived by the owner on Nov 20, 2020. It is now read-only.

generated code for ExtractTextPlugin is not compatible with latest ExtractTextPlugin #70

Description

@pjordaan

If I install the latest version of extract-text-webpack-plugin(@2.1.0), I get the following error:

Error: Breaking change: ExtractTextPlugin now only takes a single argument. Either an options object *or* the name of the result file.
Example: if your old code looked like this:
    new ExtractTextPlugin('css/[name].css', { disable: false, allChunks: true })

You would change it to:
    new ExtractTextPlugin({ filename: 'css/[name].css', disable: false, allChunks: true })

They changed the signature of ExtractTextPlugin.

Maybe we can make it work for both versions by overriding fn_extract_text_plugin_css:

var fn_extract_text_plugin_css = require("extract-text-webpack-plugin");
if (fn_extract_text_plugin_css.length < 2) {
      fn_extract_text_plugin_css = function (filename, options) {
          options.filename = filename;
           return require('extract-text-webpack-plugin')(options);
      };
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions