8000 fix: Generate meaningful CSS Modules class names (#357) · mrauhu/vue-meteor@6f9c1ee · GitHub
[go: up one dir, main page]

Skip to content

Commit 6f9c1ee

Browse files
red-meadowAkryum
authored andcommitted
fix: Generate meaningful CSS Modules class names (meteor-vue#357)
Using class names in the form of `.<vue_component_name>_<local_class_name>__<hash>` (similarly to `vue-loader`) instead of `.vue-module-<hash>-<hash>` should simplify debugging a lot.
1 parent cbcfe11 commit 6f9c1ee

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/vue-component/plugin/tag-handler.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,10 @@ VueComponentTagHandler = class VueComponentTagHandler {
358358
if (cssModules === undefined) { cssModules = {} }
359359
cssModules[moduleName] = { ...(cssModules[moduleName] || {}), ...json }
360360
},
361-
generateScopedName (exportedName, filePath) {
362-
return `vue-module-${Hash(filePath)}-${Hash(exportedName)}`
363-
},
361+
362+
// Generate a class name in the form of .<vue_component_name>_<local_class_name>__<hash>
363+
// Ref.: https://github.com/css-modules/postcss-modules#generating-scoped-names
364+
generateScopedName: '[name]_[local]__[hash:base64:5]'
364365
}))
365366
isAsync = true
366367
}

0 commit comments

Comments
 (0)
0