Draft
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Adds Rspack as an alternative bundler for
webpack_bundleandwebpack_devserver, addressing #159.A new
bundlerparameter ("webpack"or"rspack", default"webpack") controls which bundler is used. When set to"rspack", the rules use@rspack/coreand@rspack/cliinstead ofwebpackandwebpack-cli, via a newrspack_binarymacro that mirrors the existingwebpack_binary.Config merging:
Rspack CLI doesn't support
--merge, so when a customwebpack_configis provided it replaces the generated base config entirely. Without a custom config the generated base config is used as-is. This is documented in thebundlerparam docstrings and the README.Performance:
Rspack's Rust-based architecture provides significant speedups over webpack. In published benchmarks rspack is 4-6x faster for production builds and up to 15x+ faster for dev startup on larger projects. In a real-world production web application (~10k modules with SWC loaders, CSS extraction, and code splitting), we measured approximately 2.3x (dev) and 3.2x (prod) end-to-end Bazel build speedup.
Changes are visible to end-users: yes
Test plan
webpack/tests/simple: rspack with custom config and with generated configwebpack/tests/devtool-override: rspack with devtool overridewebpack/tests/worker: rspack with workers enabledwebpack/tests/devserver: rspack devserver targete2e/smoke: rspack end-to-end smoke test with production-mode output comparison