don't cache transpiled js in dev mode

This commit is contained in:
Chris Wanstrath 2025-12-15 13:42:45 -08:00
parent 68406a0a80
commit 88eab4ece2

View File

@ -146,7 +146,9 @@ export async function transpile(path: string): Promise<string> {
const { mtime } = await stat(path) const { mtime } = await stat(path)
const key = `${path}?${mtime}` const key = `${path}?${mtime}`
let cached = transpileCache[key] // no caching in dev mode
let cached = process.env.NODE_ENV === 'production' ? transpileCache[key] : undefined
if (!cached) { if (!cached) {
const result = await Bun.build({ const result = await Bun.build({
entrypoints: [path], entrypoints: [path],