Skip to content

Commit b4e5d76

Browse files
author
zhutianjian3
committed
fix(harmony): use isAbsolute
1 parent 4888d04 commit b4e5d76

File tree

1 file changed

+2
-2
lines changed
  • packages/taro-vite-runner/src/harmony

1 file changed

+2
-2
lines changed

packages/taro-vite-runner/src/harmony/page.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export default function (viteCompilerContext: ViteHarmonyCompilerContext): Plugi
108108
let importPath = value[0]
109109
const ext = path.extname(importPath)
110110
const basename = path.basename(importPath, ext)
111-
if (importPath.startsWith('/')) {
111+
if (path.isAbsolute(importPath)) {
112112
importPath = path.relative(path.dirname(rawId), importPath)
113113
}
114114
ncObj[key] = [path.join(path.dirname(importPath), basename), value[1]]
@@ -165,7 +165,7 @@ export default function (viteCompilerContext: ViteHarmonyCompilerContext): Plugi
165165
let importPath = value[0]
166166
const ext = path.extname(importPath)
167167
const basename = path.basename(importPath, ext)
168-
if (importPath.startsWith('/')) {
168+
if (path.isAbsolute(importPath)) {
169169
importPath = path.relative(path.dirname(rawId), importPath)
170170
}
171171
ncObj[key] = [path.join(path.dirname(importPath), basename), value[1]]

0 commit comments

Comments
 (0)