Commit 91ef19e2 authored by 前端-许佳敏's avatar 前端-许佳敏

chore: 处理windows下的路径错误

parent e742f622
......@@ -16,7 +16,7 @@ function validateRouterJson(json, testLocalJson) {
// 本地的json
while(dispatchs.length) {
const item = dispatchs.shift()
hashMapReSource[item] = true
hashMapReSource['/' + item.substring(item.indexOf('src')).replace(/\\/g, '/')] = true
dispatchs.push(...dispatchDir(item, excludes))
}
}
......@@ -25,7 +25,7 @@ function validateRouterJson(json, testLocalJson) {
function transformJson(json) {
return Array.isArray(json) ? json.reduce((target, maps) => {
if (maps.component) {
target[maps.component.replace('@', resourcePath).replace('./', resourcePath + '/pages/')] = true
target[maps.component.replace('@', '/src').replace('./', '/src/pages/')] = true
}
if (maps.routes) {
target = Object.assign(target, transformJson(maps.routes))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment