UNPKG

522 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const tslib_1 = require("tslib");
4const path_1 = tslib_1.__importDefault(require("path"));
5exports.getBaseDir = (pathString, publicPath) => {
6 if (!publicPath || publicPath === "/") {
7 return pathString;
8 }
9 const relativePath = path_1.default.resolve(publicPath)
10 .split("/")
11 .filter((item) => item.length)
12 .map(() => "..")
13 .join("/");
14 return path_1.default.join(pathString, relativePath);
15};