-
-
Notifications
You must be signed in to change notification settings - Fork 109
enable custom css modules compilers #132
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
enable custom css modules compilers #132
Conversation
Akryum
left a comment
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.
global.vue.cssModules seems fine to me 👍
|
Would you mind documenting these changes? 😄 |
|
Documentation?! The horror! Yeah, I'll write this up. |
|
I'm hoping to knock this out this weekend, and just wanted to clarify what I'm documenting. So far I've got:
I was planning to document adding your own custom css modules compiler, but I'm not sure where I should put that since I don't see explicit instructions for others (like the |
|
You could add the package to the "lang" list, and then document in its README what it does and how to use the features it add to the Vue components. |
…comunity package.
…antreid/meteor-vue-component into css-modules-custom-compiler
|
I found a logging statement leftover from my initial CSS modules PR, so I removed that. |
|
Awesome! Thank you for your work! |
I'd like to add support for custom CSS modules compilers similar to your support for custom "lang" processors. If there is no custom processor, it defaults to the basic processor I added in #117.
The main reason for this PR is so I can interop with my css-modules build compiler, allowing the user to import other CSS modules files and use all of the configuration options I provide.
The compile call is identical to the one for lang compilers with the addition of passing in the
styleTagand sourcemap. I pass in thestyleTagbecause I need to set theautoprefixattribute tooffif the user is already using autoprefixer through my package as well as read themoduleattribute so I can implement support for multiple style tags. I'll need to make another PR eventually since the module attribute should also allow overriding the computed property name.You'll also note that in handling the result I append to the
jsvariable - this is because CSS modules reference other files via composes (as opposed to including them in the source like sass imports). My plugin therefore outputsrequirestatements so Meteor will load those referenced files.I wasn't sure how exactly you'd want the cssModules compiler to be specified so for now I used
global.vue.cssModules.