bugfix: 修复windows preload 加载路径错误

This commit is contained in:
muwoo 2021-12-21 18:38:19 +08:00
parent 581599614b
commit 2cd6bab58c

View File

@ -15,14 +15,14 @@ const getPreloadPath = (plugin, pluginIndexPath) => {
return path.resolve(__static, `../feature/public/preload.js`); return path.resolve(__static, `../feature/public/preload.js`);
} }
if (tplPath) { if (tplPath) {
return path.resolve(indexPath.replace("file:", ""), `./`, preload); return path.resolve(getRelativePath(indexPath), `./`, preload);
} }
return path.resolve(pluginIndexPath.replace("file:", ""), `../`, preload); return path.resolve(getRelativePath(pluginIndexPath), `../`, preload);
} }
if (tplPath) { if (tplPath) {
return path.resolve(indexPath.replace("file:", ""), `./`, preload); return path.resolve(getRelativePath(indexPath), `./`, preload);
} }
return path.resolve(pluginIndexPath.replace("file:", ""), `../`, preload); return path.resolve(getRelativePath(pluginIndexPath), `../`, preload);
}; };
export default () => { export default () => {