Within my vite.config.ts
file, I have specified a configuration for CSS modules.
return defineConfig({
...
css: {
...
modules: {
localsConvention: "camelCase",
generateScopedName: "[name]__[local]__[hash:base64:2]"
}
},
plugins: [
vue()
]
});
Upon implementation, the generated class names resemble this pattern
Output of CSS module class name
However, an undesired string gets included between the component name and the local class name (something like)
-vue-vue-type-style-index-0-lang-module
Is there a way to eliminate this string and achieve a format such as
ComponentName__class_hash
I attempted to employ a function within the generateScopedName
property but struggled to assign a unique hash to each class
https://vitejs.dev/config/shared-options.html#css-modules