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

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

Open
pjordaan opened this issue Mar 15, 2017 · 0 comments

Comments

@pjordaan
Copy link

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);
      };
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant