This repository was archived by the owner on Jan 18, 2022. It is now read-only.
File tree 3 files changed +8
-11
lines changed 3 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -15,16 +15,13 @@ const config = [
15
15
// Resolve packages from `node_modules` e.g. `style-inject` module
16
16
// used by `rollup-plugin-postcss` to inline CSS.
17
17
NodeResolve ( ) ,
18
- VuePlugin ( ) ,
19
- // Process only `<style module>` blocks.
20
- PostCSS ( {
21
- modules : {
18
+ VuePlugin ( {
19
+ // PostCSS-modules options for <style module> compilation
20
+ cssModulesOptions : {
22
21
generateScopedName : '[local]___[hash:base64:5]' ,
23
22
} ,
24
- include : / & m o d u l e = .* \. c s s $ / ,
25
23
} ) ,
26
- // Process all `<style>` blocks except `<style module>`.
27
- PostCSS ( { include : / (?< ! & m o d u l e = .* ) \. c s s $ / } ) ,
24
+ PostCSS ( ) ,
28
25
] ,
29
26
external ( id ) {
30
27
return / ^ ( v u e ) $ / . test ( id )
Original file line number Diff line number Diff line change @@ -18,6 +18,6 @@ export default {
18
18
19
19
<style scoped>
20
20
.green {
21
- color : red ;
21
+ color : green ;
22
22
}
23
23
</style >
Original file line number Diff line number Diff line change @@ -56,9 +56,9 @@ describe('css-modules', () => {
56
56
expect ( result . output [ 0 ] . code ) . not . toEqual (
57
57
expect . stringContaining ( '.red {\n color: red;\n}' )
58
58
)
59
- expect ( result . output [ 0 ] . code ) . toEqual ( expect . stringContaining ( '._red_ ' ) )
59
+ expect ( result . output [ 0 ] . code ) . toEqual ( expect . stringContaining ( '.red___ ' ) )
60
60
expect ( result . output [ 0 ] . code ) . toEqual (
61
- expect . stringContaining ( '{"red":"_red_ ' )
61
+ expect . stringContaining ( '{"red":"red___ ' )
62
62
)
63
63
} )
64
64
@@ -67,7 +67,7 @@ describe('css-modules', () => {
67
67
expect . stringContaining ( '.__scopeId = "data-v-' )
68
68
)
69
69
expect ( result . output [ 0 ] . code ) . not . toEqual (
70
- expect . stringContaining ( '.green {\n color: red ;\n}' )
70
+ expect . stringContaining ( '.green {\n color: green ;\n}' )
71
71
)
72
72
expect ( result . output [ 0 ] . code ) . toEqual (
73
73
expect . stringContaining ( '.green[data-v-' )
You can’t perform that action at this time.
0 commit comments