Skip to content

Commit 0d742e0

Browse files
Mbd06bclaude
andcommitted
fix: Resolve package aliases to src directory for subpath exports
Changed vite aliases to point to src/ directory instead of src/index.ts so that subpath imports like @ethosengine/sophia/strings resolve correctly. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e6af43e commit 0d742e0

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

vite.config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ const packageAliases = {};
1111
glob.sync(join(__dirname, "/packages/*/package.json")).forEach(
1212
(packageJsonPath) => {
1313
const pkg = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
14-
packageAliases[pkg.name] = join(dirname(packageJsonPath), pkg.source);
14+
const pkgDir = dirname(packageJsonPath);
15+
// Point to src directory for packages with subpath exports (e.g. @ethosengine/sophia/strings)
16+
// Fall back to source entry for packages without subpaths
17+
packageAliases[pkg.name] = join(pkgDir, "src");
1518
},
1619
);
1720

0 commit comments

Comments
 (0)