feat(core): add output.bundleDependencies config option#1072
Merged
Conversation
Allow users to control whether third-party dependencies from node_modules are bundled or externalized, independently of testEnvironment. - 'auto' (default): bundle in browser-like envs, externalize in node - true: always bundle all dependencies - false: always externalize all dependencies
Deploying rstest with
|
| Latest commit: |
52ce7ef
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://084f92f5.rstest.pages.dev |
| Branch Preview URL: | https://bundledependencies.rstest.pages.dev |
fi3ework
reviewed
Mar 19, 2026
fi3ework
approved these changes
Mar 23, 2026
Rsdoctor Bundle Diff AnalysisFound 12 projects in monorepo, 2 projects with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 browserPath:
📦 Download Diff Report: browser Bundle Diff 📁 core/rsdoctor-mainPath:
📦 Download Diff Report: core/rsdoctor-main Bundle Diff Generated by Rsdoctor GitHub Action |
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.
Summary
Background
Rstest ties the dependency bundling strategy to
testEnvironment— browser-like environments (jsdom, happy-dom) bundle allnode_modules, while Node externalizes them. Users have no straightforward way to override this without manually configuringoutput.externalsper-package or reaching intotools.rspack. See #1064.Implementation
output.bundleDependenciesconfig option (boolean, 'true' for browser-like test environments, 'false' for node test environment) toProjectConfigtype definition.pluginExternalto readbundleDependenciesand decide externalization independently oftestEnvironment.name.strip-ansisource code is inlined (bundled) or absent (externalized).output.externals.User Impact
Users can now set
output.bundleDependencies: falsein jsdom to externalize all dependencies, ortruein Node to bundle everything, decoupling the bundling strategy fromtestEnvironment.Related Links
Checklist