@omnia/tooling-vue
Version:
Used to bundle and serve manifests web component that build on Vue framework.
23 lines (22 loc) • 986 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.tsPathResolver = void 0;
const tslib_1 = require("tslib");
const path_1 = tslib_1.__importDefault(require("path"));
const base_1 = require("./base");
const utils_1 = require("../utils");
/**Resolve tsPath config to actual module path */
exports.tsPathResolver = (0, base_1.defineResolver)("omnia-ts-path", () => {
return {
test(source, importer, fileGraph, ctx, fromWorker) {
return !!fileGraph || utils_1.pathUtils.isTsPath(source);
},
resolve(source, importer, fileGraph, ctx, fromWorker) {
if (!fileGraph) {
throw new utils_1.ErrorHMR(`Could not find graph info from source ${source}`);
}
const absolutePath = path_1.default.join(utils_1.envUtils.getRootDirPath(), fileGraph.id);
return utils_1.pathUtils.modify(absolutePath).appendWorkerIdentifier(fromWorker).getValue();
}
};
});