File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 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';
109109 const css = `\
110110.foo {
111111 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;
112131}`
113132 const result1 = await transform ( css , '/foo.module.css' ) // server
114133 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(
32983298 const deps = new Set < string > ( )
32993299 // replace null byte as lightningcss treats that as a string terminator
33003300 // 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 )
33023302
33033303 let res : LightningCssTransformAttributeResult | LightningCssTransformResult
33043304 try {
You can’t perform that action at this time.
0 commit comments