Skip to content

Cookbook ​

Use the smallest loading strategy that matches where code is needed. This keeps the theme predictable in Liquid and gives Vite clear, explicit build boundaries.

StrategyUse it forWhere to load it
Global entryNavigation, cart UI, analytics bootstrap, and code needed on nearly every pageRender once from the layout
Page-specific entryProduct galleries, collection filters, or account pages with a clear Shopify page typeSelect an explicit entry in Liquid
Lazy-loaded moduleAn optional interaction that can be detected in the DOMDynamically import it from a loaded entry

Start with one small global entry. Add a page-specific entrypoint when an entire template family needs substantial code, and use the performance patterns for optional features within those pages.

These recipes take inspiration from the Display Skeleton Theme, particularly its separation of critical styles and theme structure. They adapt those ideas to this plugin's explicit entries and ownership rules rather than copying another Vite configuration.

For the underlying platforms, keep the Shopify theme architecture guide and Vite guide close at hand.

Recipes ​

Keep the boundary visible

Entries are public names used by Liquid. Internal modules are implementation details imported by those entries.