Function: sourceLocatorVite()
sourceLocatorVite(
options?):Plugin
Defined in: source-locator.ts:475
The standalone Vite plugin — the recommended integration.
Running our own babel pass (enforce: "pre", before vite-plugin-solid) instead of hooking vite-plugin-solid's babel option matters for two reasons, both paid for: (1) vite-plugin-solid only transforms .jsx/.tsx, so cell()/control() calls in plain .ts model files would never be instrumented; (2) the decoupling means this works for ANY consumer, not just Solid apps — the JSX stamping half applies to every JSX framework, and the factory half to anything cell-shaped.
Applies to serve AND build: factory identity injection is load-bearing (a control's compiled-in name is its durable key and tool identity), so a production build must run it too. JSX stamping remains dev-only by default (stampJsx defaults to command === "serve"); pass stampJsx: true to keep instrumentation in a production build deliberately.
Scope of processing: node_modules is always skipped (published deps carry their identity from their own build, or write explicit names). Files under the app root get both halves. Files OUTSIDE the root but not in node_modules — workspace-linked package sources consumed source-first — get the factory-identity half only, with dotdot-relative locs ("../../packages/spectra/src/store.ts:12"): a shared slice's controls are named wherever the code lives, while JSX stamping stays app-scoped so attribution keeps resolving to the app's own components. A cheap content sniff skips files with neither JSX nor a factory call. @babel/core is loaded lazily (dynamic import) and required only here — if it is missing, buildStart fails fast with a clear install hint.
Parameters
options?
Returns
Plugin