feat: souport windows

This commit is contained in:
muwoo
2021-12-21 18:03:58 +08:00
parent 571ff12730
commit 3ba4be2e4a
6 changed files with 23 additions and 3 deletions

View File

@@ -3,6 +3,10 @@ import path from "path";
import commonConst from "../../common/utils/commonConst";
import { PLUGIN_INSTALL_DIR as baseDir } from "@/common/constans/main";
const getRelativePath = (indexPath) => {
return commonConst.windows() ? indexPath.replace("file://", "") : indexPath.replace("file:", "");
}
const getPreloadPath = (plugin, pluginIndexPath) => {
const { name, preload, tplPath, indexPath } = plugin;
if (!preload) return;