Pre-bundle vendor (node_modules) dependencies for dev mode.
Scans source files with OXC.imports/2, identifies bare specifiers
(non-relative, non-URL), resolves them through node_modules, and
bundles each into a single ESM file with OXC.bundle/2.
CJS packages (e.g. React) are automatically converted to ESM during
bundling. process.env.NODE_ENV is replaced with "development"
so conditional CJS branches resolve correctly.
Bundled files are cached on disk in _build/volt/vendor/.
Summary
Functions
Bundle a single vendor specifier on demand.
Decode a URL-safe specifier back to its original form.
Encode a specifier for use in URLs (escaping @ and /).
Scan source files and pre-bundle any bare npm imports.
Read a pre-bundled vendor file by specifier.
Get the URL path for a vendor module.
Functions
@spec bundle_on_demand(String.t(), String.t() | nil, keyword()) :: {:ok, String.t()} | {:error, term()}
Bundle a single vendor specifier on demand.
Used by the dev server when a /@vendor/ request arrives for a
specifier that wasn't caught by prebundle/1 (e.g. transitive
dependency, or newly added import).
Decode a URL-safe specifier back to its original form.
Encode a specifier for use in URLs (escaping @ and /).
Scan source files and pre-bundle any bare npm imports.
Returns a map of specifier → vendor_path for import rewriting.
Options
:root— source directory to scan:node_modules— path to node_modules (default: auto-detect):force— rebuild even if cached (default:false)
Read a pre-bundled vendor file by specifier.
Get the URL path for a vendor module.