File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
packages/vite/src/node/plugins Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ import {
8383import type { ESBuildOptions } from './esbuild'
8484import { getChunkOriginalFileName } from './manifest'
8585
86+ const decoder = new TextDecoder ( )
8687// const debug = createDebugger('vite:css')
8788
8889export interface CSSOptions {
@@ -1808,8 +1809,12 @@ async function minifyCSS(
18081809 ) ,
18091810 )
18101811 }
1812+
1813+ // NodeJS res.code = Buffer
1814+ // Deno res.code = Uint8Array
1815+ // For correct decode compiled css need to use TextDecoder
18111816 // LightningCSS output does not return a linebreak at the end
1812- return code . toString ( ) + ( inlined ? '' : '\n' )
1817+ return decoder . decode ( code ) + ( inlined ? '' : '\n' )
18131818 }
18141819 try {
18151820 const { code, warnings } = await transform ( css , {
@@ -2698,8 +2703,6 @@ function isPreProcessor(lang: any): lang is PreprocessLang {
26982703}
26992704
27002705const importLightningCSS = createCachedImport ( ( ) => import ( 'lightningcss' ) )
2701-
2702- const decoder = new TextDecoder ( )
27032706async function compileLightningCSS (
27042707 id : string ,
27052708 src : string ,
You can’t perform that action at this time.
0 commit comments