File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
packages/vite/src/node/plugins Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -2695,6 +2695,7 @@ function isPreProcessor(lang: any): lang is PreprocessLang {
26952695
26962696const importLightningCSS = createCachedImport ( ( ) => import ( 'lightningcss' ) )
26972697
2698+ const decoder = new TextDecoder ( )
26982699async function compileLightningCSS (
26992700 id : string ,
27002701 src : string ,
@@ -2760,7 +2761,10 @@ async function compileLightningCSS(
27602761 : undefined ,
27612762 } )
27622763
2763- let css = res . code . toString ( )
2764+ // NodeJS res.code = Buffer
2765+ // Deno res.code = Uint8Array
2766+ // For correct decode compiled css need to use TextDecoder
2767+ let css = decoder . decode ( res . code )
27642768 for ( const dep of res . dependencies ! ) {
27652769 switch ( dep . type ) {
27662770 case 'url' :
You can’t perform that action at this time.
0 commit comments