Skip to content

Conversation

@Lyrkan
Copy link
Collaborator

@Lyrkan Lyrkan commented Feb 1, 2019

With the current version of Encore you are able to either:

  • only use standard CSS (default behavior)
  • only use CSS modules (by calling Encore.configureCssLoader())

This PR should help detecting when <style module> is used and enabling css modules accordingly (fixes #460).

Reference: https://vue-loader.vuejs.org/guide/css-modules.html#opt-in-usage

@Lyrkan Lyrkan mentioned this pull request Feb 1, 2019
Copy link
Member

@weaverryan weaverryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow! Well-done - very interesting way that this needs to be implemented!

@weaverryan
Copy link
Member

Thank you @Lyrkan!

@weaverryan weaverryan merged commit 356e538 into symfony:master Feb 2, 2019
weaverryan pushed a commit that referenced this pull request Feb 2, 2019
This PR was merged into the master branch.

Discussion
----------

Support CSS modules in Vue.js projects by default

With the current version of Encore you are able to either:

* only use standard CSS (default behavior)
* only use CSS modules (by calling `Encore.configureCssLoader()`)

This PR should help detecting when `<style module>` is used and enabling css modules accordingly (fixes #460).

**Reference:** https://vue-loader.vuejs.org/guide/css-modules.html#opt-in-usage

Commits
-------

356e538 Support CSS modules in Vue.js projects by default
@tmalley99
Copy link

Hi! Unfortunately this does not work with a language (scss) set as it used to... Can this support SCSS lang modules too?

@Lyrkan
Copy link
Collaborator Author

Lyrkan commented Feb 5, 2019

Hmm...we probably have to use the same trick for all languages since they re-include the css loader. I'll see what I can do, unless I'm missing something it shouldn't be too hard to implement.

@tmalley99
Copy link

tmalley99 commented Feb 5, 2019 via email

weaverryan added a commit that referenced this pull request Mar 1, 2019
…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
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.

CSS Modules no longer work

3 participants