Skip to content

Commit b303a16

Browse files
committed
Check api change only in development mode
1 parent 051c3ef commit b303a16

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/aleph.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,8 @@ export class Aleph implements IAleph {
487487
if (url.routePath !== '') {
488488
const specifier = nestedModules.pop()!
489489
const filepath = join(this.#workingDir, this.#config.srcDir, util.trimPrefix(specifier, 'file://'))
490-
const state = await Deno.lstat(filepath)
491-
const { handler } = await import(`file://${filepath}?mtime=${state.mtime?.getTime()}`)
490+
const qs = this.isDev ? '?mtime=' + (await Deno.lstat(filepath)).mtime?.getTime() : ''
491+
const { handler } = await import(`file://${filepath}${qs}`)
492492
return [url, handler]
493493
}
494494
}

0 commit comments

Comments
 (0)