Skip to content

Commit cb468e8

Browse files
author
LessJS Bot
committed
fix(adapter-vite): import loadBlogData from @lessjs/content main entry
Instead of the ./blog-data subpath (which requires a Vite alias or a separate exports entry), import from the main '.' entry where loadBlogData is already re-exported. This eliminates the need for a Vite resolve alias or a separate package subpath export.
1 parent 604052c commit cb468e8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

packages/adapter-vite/src/virtual-data.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ export function createBlogDataPlugin(ctx: LessBuildContext): Plugin {
5050
}
5151

5252
// Dynamic import to avoid hard dependency on @lessjs/content
53-
// at module load time (content is an optional peer)
54-
const { loadBlogData } = await import('@lessjs/content/blog-data');
53+
// at module load time (content is an optional peer).
54+
// Import from main entry (.) — loadBlogData is a pure function
55+
// re-exported there, no need for a separate subpath.
56+
const { loadBlogData } = await import('@lessjs/content');
5557

5658
const options = {
5759
contentDir: blogOpts.contentDir,

0 commit comments

Comments
 (0)