-
-
Notifications
You must be signed in to change notification settings - Fork 199
Add CSS modules support in Vue.js for Sass/Less/Stylus #511
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
* @return {Array} of loaders to use for Less files | ||
*/ | ||
module.exports = { | ||
getLoaders(webpackConfig, ignorePostCssLoader = false) { |
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.
ignorePostCssLoader
wasn't actually useful since cssLoader.getLoaders()
looks into the webpackConfig
object for that info.
* @return {Array} of loaders to use for Sass files | ||
*/ | ||
module.exports = { | ||
getLoaders(webpackConfig, sassOptions = {}) { |
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.
No point keeping a sassOptions
parameter here, the only allowed option is resolveUrlLoader
which is already handled here by directly looking into the webpackConfig
object.
* @return {Array} of loaders to use for Stylus files | ||
*/ | ||
module.exports = { | ||
getLoaders(webpackConfig, ignorePostCssLoader = false) { |
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.
ignorePostCssLoader
wasn't needed here since cssLoader.getLoaders()
look into the webpackConfig
object for that info.
Can the styles still be called by $style.scssClass?
…Sent from my iPhone
On Feb 5, 2019, at 8:56 AM, Vincent Le Biannic ***@***.***> wrote:
@Lyrkan commented on this pull request.
In lib/loaders/less.js:
> * @return {Array} of loaders to use for Less files
*/
module.exports = {
- getLoaders(webpackConfig, ignorePostCssLoader = false) {
ignorePostCssLoader wasn't actually useful since cssLoader.getLoaders() look into the webpackConfig object for that info.
In lib/loaders/sass.js:
> * @return {Array} of loaders to use for Sass files
*/
module.exports = {
- getLoaders(webpackConfig, sassOptions = {}) {
No point keeping a sassOptions parameter here, the only allowed option is resolveUrlLoader which is already handled here by directly looking into the webpackConfig object.
In lib/loaders/stylus.js:
> * @return {Array} of loaders to use for Stylus files
*/
module.exports = {
- getLoaders(webpackConfig, ignorePostCssLoader = false) {
ignorePostCssLoader wasn't needed here since cssLoader.getLoaders() look into the webpackConfig object for that info.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@Chesskingt Yes, that's the default name if you don't specify one in Feel free to test it: |
Cool! Thanks!
…Sent from my iPhone
On Feb 5, 2019, at 12:30 PM, Vincent Le Biannic ***@***.***> wrote:
@Chesskingt Yes, that's the default name if you don't specify one in module.
I used custom names in my fixtures in order to have multiple modules in a single .vue file.
Feel free to test it: yarn add --dev git://github.com/Lyrkan/webpack-encore.git#scss-less-modules
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Is this being merged into main master today? |
@Lyrkan ? :) |
@Chesskingt I usually don't merge my own PRs without any review (unless that's something really trivial or a security issue). And even if I did I can't publish a new version on npm anyway, so you'll have to a wait for @weaverryan to come by ^^ |
Ok :)
…Sent from my iPhone
On Feb 6, 2019, at 11:38 AM, Vincent Le Biannic ***@***.***> wrote:
@Chesskingt I usually don't merge my own PRs without any review (unless that's something really trivial or a security issue). And even if I did I can't publish a new version on npm anyway, so you'll have to a wait for @weaverryan to come by ^^
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@weaverryan this in next release? |
Excellent work - thanks @Lyrkan! |
…Lyrkan) This PR was merged into the master branch. Discussion ---------- Add CSS modules support in Vue.js for Sass/Less/Stylus As noted in #508 (comment), that previous PR actually only added support for standard CSS modules, but didn't work for other languages. This new PR makes it so it also works with the Scss, Less and Stylus syntaxes (using the same principle). Ping @Chesskingt :) Commits ------- 3224e6c Add CSS modules support in Vue.js for Sass/Less/Stylus
As noted in #508 (comment), that previous PR actually only added support for standard CSS modules, but didn't work for other languages.
This new PR makes it so it also works with the Scss, Less and Stylus syntaxes (using the same principle).
Ping @Chesskingt :)