Skip to content

Commit 29f91f9

Browse files
committed
fix(runner): 修复同步打包原生组件时, 后缀错误识别问题
1 parent 2d003ab commit 29f91f9

File tree

1 file changed

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

1 file changed

+2
-1
lines changed

packages/taro-vite-runner/src/harmony/template/render.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,11 @@ export default class RenderParser extends BaseParser {
117117
if (meta.isPackage) {
118118
importList.push(`import ${name} from '${meta.scriptPath}'`)
119119
} else {
120+
const etx = path.extname(meta.scriptPath)
120121
const nativePath = path.posix
121122
.relative(this.context.sourceDir, meta.scriptPath)
122123
.replace(/[\\/]+/g, '/')
123-
.replace(/\.ets$/, '')
124+
.replace(new RegExp(`\\${etx}$`), '')
124125
importList.push(`import ${name} from './${nativePath}'`)
125126
}
126127
})

0 commit comments

Comments
 (0)