lawsynth/apps/studio/tests/workspace-loader.mjs
2026-08-16 23:40:41 +03:00

16 lines
869 B
JavaScript

const workspaceEntries = {
"@lawsynth/api-client": "../../../packages/api-client/dist/index.js",
"@lawsynth/state-store": "../../../packages/state-store/dist/index.js",
"@lawsynth/world-schema": "../../../packages/world-schema/dist/src/index.js",
"@lawsynth/world-viewer": "../../../packages/world-viewer/dist/src/index.js",
"@lawsynth/chart-core": "../../../packages/chart-core/dist/src/index.js",
"@lawsynth/layout-engine": "../../../packages/layout-engine/dist/src/index.js",
};
/** Resolve workspace package specifiers while running the compiled Studio output without a package-manager symlink farm. */
export function resolve(specifier, context, nextResolve) {
const entry = workspaceEntries[specifier];
if (entry !== undefined) return { url: new URL(entry, import.meta.url).href, shortCircuit: true };
return nextResolve(specifier, context);
}