Skip to content

Commit

Permalink
fix(runner): for wins path
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakaryCode committed Aug 28, 2024
1 parent 78a3f5b commit 7607b10
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/taro-vite-runner/src/harmony/template/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ export default class RenderParser extends BaseParser {
if (meta.isPackage) {
importList.push(`import ${meta.name} from '${meta.scriptPath}'`)
} else {
const nativePath = path.relative(this.context.sourceDir, meta.scriptPath).replace(/\.ets$/, '')
const nativePath = path.posix.relative(this.context.sourceDir, meta.scriptPath)
.replace(/[\\/]+/g, '/').replace(/\.ets$/, '')
importList.push(`import ${meta.name} from './${nativePath}'`)
}
})
Expand Down

0 comments on commit 7607b10

Please sign in to comment.