Controller Preloads

Production module preloads for selected application or package Stimulus controllers

View documentation

Preload configured controllers

Conceptual

Place the component after @@vite. In production it emits module preload links for the controllers configured under hotwire.controllers.preload; while the Vite development server is active it renders nothing. This playground already uses it in the page layout.

Controller preloads belong in the document head, so there is no visible widget to duplicate in this preview. They move selected lazy controller requests earlier without eagerly evaluating those modules.

Keep @vite first so entrypoint assets are already known and are not emitted again as controller-specific preloads.

Override the selection for one page

Conceptual

Pass Stimulus identifiers when one page has a more specific critical path than the application default. Nested identifiers retain their -- separator.

This selection preloads catalog-search and reveal for this response only. Application controllers take precedence over package controllers with the same identifier.