fix(core): fix wrong path on windows deploy (#15000)

This commit is contained in:
JimenezLi
2024-03-29 02:58:56 +08:00
committed by GitHub
parent 97fdc24e84
commit b9ff661337
+3 -3
View File
@@ -45,7 +45,7 @@ if (Object.keys(modules).length) {
| {
namespace: Namespace;
};
const namespace = module.split('/')[1];
const namespace = module.split(/[/\\]/)[1];
if ('namespace' in content) {
namespaces[namespace] = Object.assign(
{
@@ -65,13 +65,13 @@ if (Object.keys(modules).length) {
for (const path of content.route.path) {
namespaces[namespace].routes[path] = {
...content.route,
location: module.split('/').slice(2).join('/'),
location: module.split(/[/\\]/).slice(2).join('/'),
};
}
} else {
namespaces[namespace].routes[content.route.path] = {
...content.route,
location: module.split('/').slice(2).join('/'),
location: module.split(/[/\\]/).slice(2).join('/'),
};
}
}