Skip to content

feat(workspace | preview): migrate from webpack to rspack#10187

Merged
luvkapur merged 35 commits intomasterfrom
perf/rspack-migration
Feb 10, 2026
Merged

feat(workspace | preview): migrate from webpack to rspack#10187
luvkapur merged 35 commits intomasterfrom
perf/rspack-migration

Conversation

@luvkapur
Copy link
Member

@luvkapur luvkapur commented Feb 5, 2026

This PR migrates the UI server and Preview pre-bundle pipelines from Webpack to Rspack.

  • Replaced Webpack bundling paths for:

    • teambit.ui-foundation/ui (dev/prod/ssr UI bundling)
    • teambit.preview/preview pre-bundle generation
  • Added/standardized Rspack config flow:

    • SWC-based transpilation
    • Rspack CSS pipeline (experiments.css)
    • Rspack asset modules
    • shared Rspack manifest generation (asset-manifest.json)
  • Reduced classic loader usage and moved core work to Rspack built-ins where supported.

luvkapur and others added 17 commits February 2, 2026 16:21
Reduces code duplication between rspack.dev.config.ts and
rspack.browser.config.ts by extracting shared rules (SWC loader,
source-map loader, style rules, font rules) and constants
(moduleFileExtensions, RspackManifestPlugin) into a common module.

Also fixes regex backtracking vulnerability in navigateFallbackDenylist
flagged by SonarQube (changed [^/?]+ to [^/.?]+ to prevent overlapping
character classes).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@luvkapur luvkapur changed the title feat(workspace): rspack feat(workspace | preview): migrate from webpack to rspack Feb 6, 2026
luvkapur and others added 11 commits February 6, 2026 14:29
…k configs

Extract shared resolveAlias(), resolveFallback, and resolveFallbackDev
into rspack.common.ts to eliminate duplicated blocks across browser,
dev, and SSR configs. Net -32 lines.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Export RspackManifestPlugin from @teambit/ui and import it in the
pre-bundle rspack config instead of maintaining an identical copy.
Fixes SonarCloud duplicated lines density flag.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…undle

Extract RspackManifestPlugin into its own file so that exporting it
from @teambit/ui index does not pull rspack.common.ts and its
require.resolve calls for loaders into the preview bundle graph.
Fixes Can not resolve os/http/vm errors during --rebuild.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Revert RspackManifestPlugin export from @teambit/ui index to avoid
  pulling build-time code into the browser bundle (caused runtime
  .replace error on undefined)
- Give pre-bundle its own local copy of RspackManifestPlugin in a
  separate file (rspack-manifest-plugin.ts)
- Fix import/default lint errors: use named import for rspack
- Fix TS errors: Stats.toString needs args, proxy type cast
- All lint and type checks pass

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@luvkapur luvkapur marked this pull request as ready for review February 9, 2026 22:19
@sonarqubecloud
Copy link

@luvkapur luvkapur enabled auto-merge (squash) February 10, 2026 18:12
@luvkapur luvkapur merged commit 225881d into master Feb 10, 2026
13 checks passed
@luvkapur luvkapur deleted the perf/rspack-migration branch February 10, 2026 19:04
luvkapur added a commit that referenced this pull request Feb 12, 2026
Reverts the following commits:
- 9527d01 fix(rspack): migrate to built in manifest plugin (#10194)
- 225881d feat(workspace | preview): migrate from webpack to rspack (#10187)
- 93b656a feat(workspace): enable graphql batching by default (#10188)

Restores webpack-based dev server and preview bundling.
Disables graphql batching (reverts to non-batched default).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants