Zudoku uses a Vite transform to scan your code for specific patterns to determine which modules belong to which routes. To ensure your content is correctly isolated into protected chunks, use one of these two supported shapes:
Shape A: Object literal with path property
Any object containing a string path property. All dynamic import() calls within the other properties of this object are registered as subtree-scoped to that path.
{ path: "/admin", lazy: () => import("./AdminPage") }
Shape B: Dictionary keyed by route path
An object where the keys are route-path strings (starting with / and containing no .) and the values are arrow functions calling import().
const fileImports = {
"/docs/intro": () => import("./intro.mdx"),
"/docs/guides": () => import("./guides.mdx"),
};
// Shape A
{ path: "/admin", lazy: () => import("./AdminPage") }
// Shape B
const fileImports = {
"/docs/intro": () => import("./intro.mdx"),
"/docs/guides": () => import("./guides.mdx"),
};