Skip to content

Commit

Permalink
fix require
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Oct 3, 2022
1 parent 5be8709 commit b360d92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function resolveCompiler(root: string): typeof _compiler {
return compiler
}

const _require = createRequire(import.meta.url)
const _require = process.env.VITEST ? require : createRequire(import.meta.url)
function tryRequire(id: string, from?: string) {
try {
return from
Expand Down

0 comments on commit b360d92

Please sign in to comment.