@@ -2,6 +2,7 @@ import {injectCdnProxy} from './proxy.js'
22import { parseServerEvent } from './server-utils.js'
33import { getLiquidTagContent } from './liquid-tag-content.js'
44import { lookupMimeType } from '@shopify/cli-kit/node/mimes'
5+ import { Buffer } from 'node:buffer'
56import { defineEventHandler , H3Event , serveStatic , setResponseHeader , sendError , createError } from 'h3'
67import { joinPath } from '@shopify/cli-kit/node/path'
78import type { Theme , ThemeAsset , VirtualFileSystem } from '@shopify/cli-kit/node/themes/types'
@@ -130,7 +131,7 @@ function handleStylesCss(ctx: DevServerContext, event: H3Event) {
130131
131132 return serveStatic ( event , {
132133 getContents : ( ) => stylesheet ,
133- getMeta : ( ) => ( { type : 'text/css' , size : stylesheet . length , mtime : new Date ( ) } ) ,
134+ getMeta : ( ) => ( { type : 'text/css' , size : Buffer . byteLength ( stylesheet ) , mtime : new Date ( ) } ) ,
134135 } )
135136}
136137
@@ -190,7 +191,7 @@ function handleBlockScriptsJs(ctx: DevServerContext, event: H3Event, kind: 'bloc
190191
191192 return serveStatic ( event , {
192193 getContents : ( ) => javascript ,
193- getMeta : ( ) => ( { type : 'text/javascript' , size : javascript . length , mtime : new Date ( ) } ) ,
194+ getMeta : ( ) => ( { type : 'text/javascript' , size : Buffer . byteLength ( javascript ) , mtime : new Date ( ) } ) ,
194195 } )
195196}
196197
0 commit comments