Commit 92125b4 1 parent 644599d commit 92125b4 Copy full SHA for 92125b4
File tree 2 files changed +20
-1
lines changed
2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,25 @@ composes: bar from '@/css/bar.module.css';
109
109
const css = `\
110
110
.foo {
111
111
color: red;
112
+ }`
113
+ const result1 = await transform ( css , '/foo.module.css' ) // server
114
+ const result2 = await transform ( css , '/foo.module.css?direct' ) // client
115
+ expect ( result1 . code ) . toBe ( result2 . code )
116
+ } )
117
+
118
+ test ( 'custom generateScopedName with lightningcss' , async ( ) => {
119
+ const { transform } = await createCssPluginTransform ( {
120
+ configFile : false ,
121
+ css : {
122
+ modules : {
123
+ generateScopedName : 'custom__[hash:base64:5]' ,
124
+ } ,
125
+ transformer : 'lightningcss' ,
126
+ } ,
127
+ } )
128
+ const css = `\
129
+ .foo {
130
+ color: red;
112
131
}`
113
132
const result1 = await transform ( css , '/foo.module.css' ) // server
114
133
const result2 = await transform ( css , '/foo.module.css?direct' ) // client
Original file line number Diff line number Diff line change @@ -3298,7 +3298,7 @@ async function compileLightningCSS(
3298
3298
const deps = new Set < string > ( )
3299
3299
// replace null byte as lightningcss treats that as a string terminator
3300
3300
// https://github.com/parcel-bundler/lightningcss/issues/874
3301
- const filename = id . replace ( '\0' , NULL_BYTE_PLACEHOLDER )
3301
+ const filename = removeDirectQuery ( id ) . replace ( '\0' , NULL_BYTE_PLACEHOLDER )
3302
3302
3303
3303
let res : LightningCssTransformAttributeResult | LightningCssTransformResult
3304
3304
try {
You can’t perform that action at this time.
0 commit comments