UNPKG

@storm-stack/core

Version:

A build toolkit and runtime used by Storm Software in TypeScript applications

37 lines (35 loc) 1.11 kB
import { __name } from './chunk-43IZMM3W.js'; import { joinPaths } from '@stryke/path/join-paths'; import { resolvePackage } from '@stryke/path/resolve'; async function resolvePath(context, file) { let path = context.vfs.resolvePath(file); if (path) { return path; } path = file; if (context.vfs.existsSync(path)) { return path; } path = joinPaths(context.options.workspaceConfig.workspaceRoot, file); if (context.vfs.existsSync(path)) { return path; } path = joinPaths(context.options.workspaceConfig.workspaceRoot, context.options.projectRoot, file); if (context.vfs.existsSync(path)) { return path; } path = joinPaths(context.options.projectRoot, file); if (context.vfs.existsSync(path)) { return path; } return resolvePackage(file, { paths: [ context.options.workspaceConfig.workspaceRoot, joinPaths(context.options.workspaceConfig.workspaceRoot, context.options.projectRoot) ] }); } __name(resolvePath, "resolvePath"); export { resolvePath }; //# sourceMappingURL=chunk-JX6IT2MW.js.map //# sourceMappingURL=chunk-JX6IT2MW.js.map