Wire up Rspack builds, dev server, asset namespacing and CI (Rspack split 4/4)
Wires the Rspack build and dev server end to end, selected by a single ENABLE_RSPACK variable:
- Dev server:
scripts/frontend/webpack_dev_server.jsrunsrspack servewhenENABLE_RSPACK=true(otherwise the Webpack dev server), on the same dev-server port. - Production build:
assets.rakebuilds with Rspack underENABLE_RSPACK. - Manifest: Rspack emits
manifest.rspack.jsonnext to Webpack'smanifest.jsonin the same/assets/webpack/folder (content-hashed files coexist).Gitlab::Webpack::Manifestcan load either manifest (memoized per filename), andWebpackHelperreads the Rspack one whenENABLE_RSPACKis set. - Asset SHA:
assets_shanamespaces the compiled-output cache key by bundler, so Rspack and Webpack never share the CI cache. - CI: skips the Webpack-only jobs (dev-server memory test, bundle-size review) when
ENABLE_RSPACKis set;.mjsconfig changes trigger the right jobs.
Inert by default: nothing changes unless ENABLE_RSPACK is set.
Verify locally
Production build + static serve
ENABLE_RSPACK=true NODE_ENV=production yarn build # or: yarn rspack-prodRspack compiles with 0 errors and emits content-hashed, gzipped bundles plus manifest.rspack.json to public/assets/webpack/. To serve that build through Rails:
gdk config set webpack.enabled false && gdk reconfigure # revert with `true`With ENABLE_RSPACK=true in the Rails environment, open the key pages (MR diffs, repository, boards, dashboard) and confirm they render with no console errors.
Dev server
ENABLE_RSPACK=true yarn dev-serverRuns rspack serve (HMR + lazy compilation) on the Webpack dev-server port; Rails proxies /assets/webpack to it and, with ENABLE_RSPACK=true in the Rails environment, reads manifest.rspack.json.
Rollout
This MR is the runtime switch (ENABLE_RSPACK) that the rest of the cutover builds on:
- Dev — gitlab-development-kit!6068 (merged) makes Rspack the default GDK bundler with zero
gdk.ymlchanges: it exportsENABLE_RSPACKfor all services and disables Vite, relying on this MR's dev-server dispatch andmanifest.rspack.jsonselection. Verified end to end on a Vite-enabled GDK — Vite users auto-switch to Rspack, MR pages load with Rspack assets and no Vite references. - Production — !246320 (merged) serves Rspack-built assets behind the
rspack_production_assetsflag, reusing the samemanifest.rspack.jsonmechanism added here.
Part of splitting the opt-in Rspack build (!242376 (closed)). MR1-MR3 (!243055 (merged), !243056 (merged), !243057 (merged)) are merged.
Epic: &22569 · Proposal: #604382 (closed)