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

Support for Less files #204

Merged
merged 4 commits into from
Sep 20, 2015
Merged

Support for Less files #204

merged 4 commits into from
Sep 20, 2015

Conversation

nicolabortignon
Copy link
Contributor

Added support for less file.
Sass is still used uniquely throughout the examples, but now is possible to require() .less files as well.

@nicolabortignon
Copy link
Contributor Author

Fixes #202 and #158.

erikras added a commit that referenced this pull request Sep 20, 2015
@erikras erikras merged commit e9456ee into erikras:master Sep 20, 2015
@erikras
Copy link
Owner

erikras commented Sep 20, 2015

Very nice. 👍

@catamphetamine
Copy link
Contributor

Well well well...

So, everywhere in webpack configs you have

           { test: /\.less$/, loader: 'style!css!less' },
           { test: /\.scss$/, loader: 'style!css?modules&importLoaders=2&sourceMap&localIdentName=[local]___[hash:base64:5]!autoprefixer?browsers=last 2 version!sass?outputStyle=expanded&sourceMap' }

No wonder it throws an Exception while JSON parsing less modules - because you don't use "modules" parameter for "css" loader.
Make up your mind: either you are using "css modules" feature for less or you don't.
This is a complex topic for a newbie.
You could've just copy pasted everything from scss.
You chose your own config instead and that's the reason it doesn't work.

@catamphetamine
Copy link
Contributor

@nicolabortignon parser function takes the final loadered css and transforms it to anything you'd like it to be when require()d

@nicolabortignon
Copy link
Contributor Author

Ok, I'd say I prefer to stick with the same modules used in the scss loader. If you agree with me, I'll PR the fix.

@catamphetamine
Copy link
Contributor

@nicolabortignon I personally don't use the "modules" feature of css-loader but the difference between less and scss in your case creates a source of confusion and false bug reports, so I'd advice you to fix the differences and make the config uniform both for scss and less.

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

Successfully merging this pull request may close these issues.

None yet

3 participants