fix: stripping types error under node_modules#730
Merged
Conversation
✅ Deploy Preview for rstest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a stripping types error for TypeScript files located under node_modules by changing the default bundling behavior in the Node.js test environment. Previously, all files in node_modules were externalized, which caused issues when packages contained TypeScript source files. Now, TypeScript and JSX files are bundled regardless of their location, while JavaScript files in node_modules remain externalized.
Key changes:
- Modified external dependency logic to bundle TypeScript/JSX files (
.ts,.tsx,.jsx,.mts,.cts) from any directory includingnode_modules - Updated documentation in both English and Chinese to accurately reflect the new bundling behavior
- Simplified test setup by removing the workaround configuration that was previously needed to bundle
node_modules
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/core/src/core/plugins/external.ts |
Updated autoExternalNodeModules function to exclude TypeScript/JSX files from externalization using a regex pattern check |
website/docs/en/config/build/output.mdx |
Updated English documentation to describe the new bundling behavior for TypeScript/JSX files and JavaScript files |
website/docs/zh/config/build/output.mdx |
Updated Chinese documentation to match the English version with the new bundling behavior |
e2e/externals/fixtures/rstest.bundle.config.ts |
Removed config file that was previously needed to force bundling of node_modules |
e2e/externals/fixtures/bundle.test.ts |
Updated test description to be more specific about testing TypeScript package loading |
e2e/externals/bundle.test.ts |
Simplified test by removing the config file reference and updated test descriptions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
fix stripping types error under
node_modules.In the Node.js test environment, Rstest will bundle and transpile the following files by default:
.ts,.tsx,.jsx,.mts,.cts.node_modulesdirectory, with file extensions.js,.mjs,.cjs.Related Links
fix: #461
Checklist