Commit 9dec2ec7 authored by 前端-许佳敏's avatar 前端-许佳敏

chore: 优化windows下比对菜单脚本

parent fe2cb697
......@@ -16,7 +16,7 @@ function validateRouterJson(json, testLocalJson) {
// 本地的json
while(dispatchs.length) {
const item = dispatchs.shift()
hashMapReSource[item] = true
hashMapReSource[item.replace(process.cwd(), '')] = 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('@', resourcePath).replace('./', resourcePath + '/pages/').replace(process.cwd(), '')] = 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