Skip to content

Commit 7af3485

Browse files
committed
perf: remove shims
1 parent af2452b commit 7af3485

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/core/compiler.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { createRequire } from 'node:module'
1+
/* eslint-disable @typescript-eslint/no-require-imports */
2+
23
import type * as _compiler from 'vue/compiler-sfc'
34

45
// extend the descriptor so we can store the scopeId on it
@@ -30,11 +31,8 @@ function tryResolveCompiler(root?: string) {
3031
}
3132
}
3233

33-
const _require = createRequire(import.meta.url || __filename)
3434
function tryRequire(id: string, from?: string) {
3535
try {
36-
return from
37-
? _require(_require.resolve(id, { paths: [from] }))
38-
: _require(id)
36+
return from ? require(require.resolve(id, { paths: [from] })) : require(id)
3937
} catch {}
4038
}

tsdown.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@ import { defineConfig } from 'tsdown'
33
export default defineConfig({
44
entry: ['./src/*.ts'],
55
exports: true,
6-
shims: true,
76
inlineOnly: ['slash', '@jridgewell/gen-mapping'],
87
})

0 commit comments

Comments
 (0)