Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config-css module broken. #3

Closed
marcusalmeida opened this issue Jul 16, 2016 · 2 comments
Closed

config-css module broken. #3

marcusalmeida opened this issue Jul 16, 2016 · 2 comments

Comments

@marcusalmeida
Copy link

I tried to execute the Aurelia Skeleton command npm start , but receive the message below.

Analyzing the stacktrace I saw that has a problem with config-css module.

The constructor used on https://github.com/easy-webpack/config-css/blob/master/src/index.ts#L33 is not ok with the version 2.0.0-beta-2 from "extract-text-webpack-plugin", used on easy-webpack, on https://github.com/webpack/extract-text-webpack-plugin/blob/master/index.js#L106.

The constructor on extract-text-webpack-plugin receive an object with options and not a list of parameters like in config-css.

/my-workspace/skeleton-esnext-webpack/node_modules/@easy-webpack/config-css/node_modules/extract-text-webpack-plugin/index.js:108
throw new Error("Breaking change: ExtractTextPlugin now only takes a single argument. Either an options " +
^

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 })

The available options are:
filename: string
allChunks: boolean
disable: boolean

at new ExtractTextPlugin (/home/marcus/sandbox/javascript/webpack/skeleton-esnext-webpack/node_modules/@easy-webpack/config-css/node_modules/extract-text-webpack-plugin/index.js:108:9)
at Object.css (/home/marcus/sandbox/javascript/webpack/skeleton-esnext-webpack/node_modules/@easy-webpack/config-css/dist/index.js:22:35)
at generateConfig (/home/marcus/sandbox/javascript/webpack/skeleton-esnext-webpack/node_modules/@easy-webpack/core/dist/index.js:28:46)
at Object.<anonymous> (/home/marcus/sandbox/javascript/webpack/skeleton-esnext-webpack/webpack.config.js:127:14)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at module.exports (/home/marcus/sandbox/javascript/webpack/skeleton-esnext-webpack/node_modules/webpack/bin/convert-argv.js:93:13)
at Object.<anonymous> (/home/marcus/sandbox/javascript/webpack/skeleton-esnext-webpack/node_modules/webpack-dev-server/bin/webpack-dev-server.js:121:48)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
@lihtness
Copy link

Suggested change to fix.

Replace line 33 with,
extractText = new ExtractTextPlugin(Object.assign({}, {filename}, extractText instanceof Object ? extractText : { allChunks: allChunks, sourceMap: sourceMap }));

To make it work till the fix is in, update @easy-webpack/config-css/dist/index.js @line 22 with the same line.

@niieani
Copy link
Contributor

niieani commented Jul 16, 2016

Seems like ExtractTextPlugin has been undergoing some heavy changes in the last 12 hours; I've just updated the problematic package to the new syntax. Alternatively you can get around the issue by passing extractText: false to config-css.

@niieani niieani closed this as completed Jul 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants