-
Notifications
You must be signed in to change notification settings - Fork 915
-
Notifications
You must be signed in to change notification settings - Fork 915
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
getLocalIdent option from css-loader doesn't work #734
Comments
This is because |
We should close this issue as a wontfix for now, and put the change in loader matching strategies on the roadmap. Agreed @Squal? |
I am having a similar problem where using single file components and css modules automatically appends an _0 to all generated classnames regardless of what I set the localIdentName to. It appears that there is no way to work around this other than to use an external src for the style being used as a module. |
@DaemonCahill maybe #1104 could help you. |
Closing since this relies on some architectural re-design and currently webpack doesn't have the ideal API for what we need. I'll try to work with the webpack team to see if they can make it possible. |
https://medium.com/@hngphong_44444/reducing-css-generated-by-vue-loader-by-using-classnames-shorten-trick-aa1d25d77473 |
Do we have any movements today? |
What's the current state of this, and what is blocking? Hopefully we can move this along. |
@MitchTalmadge This issue was resolved a long time ago with release of vue-loader v15.0.0 :), read about the changes here https://vue-loader.vuejs.org/migrating.html#loader-inference If you're using vue-cli you can easily configure css-loader's options for your needs in the module.exports = {
css: {
loaderOptions: {
css: {
modules: {
getLocalIdent: () => {}
},
},
}
}
} |
In my webpack.config I have following setup:
and basically when i import my styles through
<style>
block in .vue component<style src="./Auth.scss" lang="scss" module></style>
all css classes starts with
Auth
prefix (Auth__card___3Q2YJ) when they should start withwhatever_random_class_name
. It works fine when I import styles in script tag:If i am not mistaken I think vue-loader simply doesn't support this option right now? Would be great if vue-loader would support this option as well. Thanks :)
The text was updated successfully, but these errors were encountered: