Bundled dev mode design doc and Road Map #22746
Vite Admin
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Bundled dev mode was previously called as "Full Bundle Mode".
Background and Motivation
User Guide
Q. As a user, can I use bundled dev mode now?
A. Only if your app does not use any SSR related features from Vite and the third party plugins are compatible. Third party plugins might be compatible, but we don't expect all to work. We'll be publishing plugin author guides in the future.
Q. How can I enable bundled dev mode?
A. You can enable it by
experimental.bundledDevoption or by passing--experimental-bundleflag.Q. Does bundled dev mode bundle my entire app when the dev server starts?
A. No. Bundled dev mode uses lazy bundling (a.k.a. lazy compilation): on startup it only bundles what's needed to render the page the browser actually requests, and compiles the remaining modules on demand as they're imported. This is what keeps startup non-blocking even for large apps because bundling the whole app up front would reintroduce the slow cold starts that Vite's unbundled dev server was designed to avoid. It's enabled by default, so you don't need to configure anything.
Q. Can I disable lazy bundling?
A. You normally shouldn't need to, but it can be turned off. You can set
build.rolldownOptions.experimental.devMode.lazyto opt out for debugging purposes:Key Changes in Mental Models
Since bundled dev mode bundles the files, there will be some changes in the mental models.
new URL("./foo.png", import.meta.url)should be rewritten tonew URL("../relative-path/to/output/foo.png", import.meta.url)Roadmap
Work is sequenced as a series of experimental releases and is subject to frequent adjustment as things progress.
Checked items are complete; unchecked items are planned or in progress.
Phase 1: Basic CSR support
Goal: ship the first experimental release for Vite which is usable for client side rendering apps
Target date: 2026-06-22
Phase 2: Complete CSR support
Goal: stabilize for real-world projects beyond the basic scenario. Land the HMR refactor that unblocks plugin support, get incremental rebuilds correct, and expand the support for advanced features like globs.
Target date: 2026-09-10
inputoption (vite#22642): For full bundle mode, the entrypoint has to be specified. Currently, we usebuild.rollupOptions.input, but this is not intuitive for the users.hotUpdate/handleHotUpdate, or whether a different mechanism fits.experimental.hmrPartialAccept)import.meta.globsupport: This requires watching directories, which does not have an API that can be used in plugins.transformIndexHtmlin unbundled mode to full bundle mode / build (vite#20374)this.emitFilememory leak (See rollup#6095)Phase 3: CSS HMR & template coverage
Goal: deliver proper CSS HMR and validate FBM across all create-vite templates.
Target date: 2026-11-12
Phase 4: Server environments
Goal: extend full-bundle mode beyond SPAs to server / SSR environments.
Target date: unknown at this point
TBD
ViteDevServer.ssrLoadModule/env.runner.import: Since importing a random file is not easily possible, these APIs need to change (or Rolldown needs to improve that part). One option is to restrict them to entrypoint files. Another way is to generate the bundle on the fly.ViteDevServer.pluginContainer/env.pluginContainer: difficult for the same reason as "Transforming a single module is not possible."ViteDevServer.transformRequest/env.transformRequest: difficult for the same reason as "Transforming a single module is not possible."ViteDevServer.moduleGraph/env.moduleGraph: a similar functionality is exposed fromthis.getModuleInfo; we can add the lacking functionality there.High Level Explanation of how full bundle mode may work with the module runner
High Level Explanation of how full bundle mode may work with the module runner
ViteDevServer.runner.dispatchFetch(entry)ModuleRunner.import(bundledFileEntry)on the remote runtimeThe difference is that the environment converts
entrytobundledFileEntry.Later
Deferred until after the HMR refactor; needs a feasibility pass (pros / cons / unknowns) before it's scheduled.
import x from './x.png'ornew URL('./x', import.meta.url)inside patches). Expected to touch fewer plugins than the HMR refactor.Plugin Compatibility Notes
Collapsed as it's not stable yet.
Details
ViteDevServer.waitForRequestsIdle: this API does not work with full bundle mode and does not make sense with itchunks/*.transformhook and would requirerenderChunkhook which is not called for HMR patch files. Also, runningrenderChunkhooks of JS plugins are slow.this.addWatchFileto register the dependencies properly.import.meta.globrequires). This will be tackled in the next phase.Current Status
Phase 1 (basic CSR support) is shipped. Work is now focused on Phase 2 (complete CSR support). Phase 4 (server environments) is on the PoC state.
Beta Was this translation helpful? Give feedback.
All reactions