Skip to content

Commit 6511afe

Browse files
rsbhclaude
andcommitted
fix: use resolveId plugin for @content alias across all Vite environments
resolve.alias doesn't propagate to Nitro's SSR worker fetchModule. A custom Vite plugin with resolveId hook runs in all environments. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 51087f9 commit 6511afe

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

packages/chronicle/src/server/vite-config.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,15 @@ export async function createViteConfig(
2828
},
2929
}),
3030
mdx({}, { index: false }),
31-
react()
31+
react(),
32+
{
33+
name: 'chronicle:content-alias',
34+
resolveId(id) {
35+
if (id.startsWith('@content/')) {
36+
return path.resolve(packageRoot, '.content', id.slice('@content/'.length));
37+
}
38+
},
39+
}
3240
],
3341
resolve: {
3442
alias: {

0 commit comments

Comments
 (0)