Skip to content

Commit

Permalink
fix: disable transform cache if no filename provided
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Mar 6, 2021
1 parent 5d5ee28 commit 69113bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/jiti.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ export default function createJITI (_filename: string = process.cwd(), opts: JIT
}
_resolve.paths = nativeRequire.resolve.paths

function getCache (filename: string, source: string, get: () => string): string {
if (!opts.cache) {
function getCache (filename: string | undefined, source: string, get: () => string): string {
if (!opts.cache || !filename) {
return get()
}

Expand Down

0 comments on commit 69113bc

Please sign in to comment.