-
-
Notifications
You must be signed in to change notification settings - Fork 198
Fix invalid syntax in code sample #142
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
Conversation
The parameters for ExtractTextPlugin should be an object. It's invalid in it's current form.
The word "loaders" is not accepted as valid
| test: /\.less$/, | ||
| use: ExtractTextPlugin.extract({ | ||
| fallbackLoader: 'style-loader', | ||
| loaders: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Man, this is acceptable!!! This example is loading the webpack loader with 'rules` of webpack 2. All this examples on README are about webpack 2. Take a time for read little more about webpack 2 features.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take time to read my code, the Webpack 2 docs and run the changes yourself before making comments like. I'm using Webpack ^2.2.0, and the "valid" syntax you're claiming is not valid on the docs.
| rules: [ | ||
| { | ||
| test: /\.less$/, | ||
| use: ExtractTextPlugin.extract( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this issue was fixed on my pr #140, look!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look at #127 then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh my!!! This is need be update
| use: ExtractTextPlugin.extract( | ||
| use: ExtractTextPlugin.extract({ | ||
| fallbackLoader: 'style-loader', | ||
| loaders: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is right man!! Take a time for read little more about features webpack 2, because all examples described on README are using webpack 2 and in webpack 2, it's used rules array for loaders instead loaders array. So, with rules you can use use array, like recommend for webpack, for to set the loaders, or you can use loaders array or loader for a single loader.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using Webpack ^2.2.0 and "loaders" is not valid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because needs use rules with use for loader on webpack 2
|
Thank you for your PR. But this has changed again, see #133 (comment) I'll merge whoever is faster 😁 |
|
Thanks @jhnns! Just made the update to the newest version. I think everything is good to go. |
|
Haha, sorry, I just saw that there are so many PRs addressing all this so that decided to fix it for myself (#151) now and I can close a lot of PRs. Sorry for the extra work 😁 |
The parameters for ExtractTextPlugin should be an object. It's invalid in it's current form.