Skip to content

Commit dfe0b22

Browse files
committed
fix: windows 下开启CompileMode报错 (NervJS#15252)
1 parent 4122603 commit dfe0b22

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/taro-webpack5-runner/src/plugins/MiniCompileModePlugin.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,9 @@ export default class MiniCompileModePlugin {
295295
.filter(key => (new RegExp(`-templates${fileType.templ}$`)).test(key))
296296
.map(key => {
297297
const source = new ConcatSource()
298-
source.add(`<import src="${path.relative(path.dirname(key), `./${baseTemplName}`)}"/>\n`)
298+
source.add(`<import src="${path.relative(path.dirname(key), `./${baseTemplName}`).replace(/\\/g, '/')}"/>\n`)
299299
if (fileType.xs) {
300-
const content = template.buildXsImportTemplate(path.relative(path.dirname(key), `./utils`))
300+
const content = template.buildXsImportTemplate(path.relative(path.dirname(key), `./utils`)).replace(/\\/g, '/')
301301
source.add(content)
302302
}
303303
source.add(assets[key])

0 commit comments

Comments
 (0)