Add Rspack plugins and Vue 2/3 infection (Rspack split 3/4)
What
Adds the Rspack plugins and the Vue 2/3 infection that complete a working Rspack bundle:
- Vue loader plugin: a custom
matchResourcereplacement forvue-loader@15's crashingVueLoaderPlugin. - Slim Rails manifest plugin: emits the manifest Rails consumes.
- Vue 2/3
@vue/compatinfection: a loader plus aNormalModuleReplacementPluginresolver, plus the shared scanner-graph edges they rely on.
Inert unless ENABLE_RSPACK is set.
Rspack / Webpack plugin-API interop
The main friction was porting the Vue 2/3 infection. Webpack propagates the ?vue3 marker
through the module graph by mutating resolve data in an afterResolve hook. Rspack doesn't
surface those resolve-mutation hooks the same way (it ignores beforeResolve mutations),
so that propagation can't be reused directly. We reproduce it with two pieces: a loader
that infects per-edge from the scanner's recorded import graph, and a
NormalModuleReplacementPlugin resolver for the Vue-3-only node_modules packages the
loader doesn't reach.
Verify Rspack works locally
This is the first part of the split that produces a complete, runnable Rspack bundle, so it can be verified end to end. Checked out on top of current master:
-
Install dependencies:
yarn install -
Build the production assets with Rspack:
ENABLE_RSPACK=true NODE_ENV=production yarn build # or simply: yarn rspack-prodExpected: Rspack compiles with 0 errors (a couple of warnings are expected), emitting minified, content-hashed, gzip-compressed bundles to
public/assets/webpack/. This exercises the Vue loader, the slim manifest, and the Vue 2/3 infection end to end. -
Serve that build through Rails and smoke-test in a browser:
gdk config set webpack.enabled false && gdk reconfigure # revert with `true`Open the key pages (MR diffs, repository, boards, dashboard) and confirm:
- they render with no console errors;
- Monaco (Web IDE / file editor) loads its workers via the native-ESM path;
- any Vue 3 (
@vue/compat) app populates rather than rendering empty (the infection check).
Only a manual production build is needed for this; the dev-server path
(DEV_SERVER_BUNDLER=rspack), the Rails asset-pipeline integration, and CI coverage land
in !243058 (merged).
Part of splitting the opt-in Rspack build (!242376 (closed)) into reviewable pieces; !243058 (merged) (build
- dev-server wiring + CI) builds on this.
Epic: &22569 · Proposal: #604382 (closed)