Skip to content

feat: external node_modules packages by default #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

9aoy
Copy link
Contributor

@9aoy 9aoy commented Apr 14, 2025

Summary

Externalize node_modules packages by default. These dependencies will not be transformed & bundled.

  • adding a function for automatically externalizing Node modules
    • Added autoExternalNodeModules function in rsbuild.ts to automatically externalize Node modules based on their location in node_modules and specific dependency types.
  • enabling experimental VM module support, improving dynamic module loading
    • Updated loadModule in loadModule.ts to support dynamic imports using import.meta.resolve and pathToFileURL. This allows dynamic resolution and loading of module dependencies.
    • Ensured loadModule calls in worker/index.ts are awaited to handle asynchronous module loading properly.

Improvements to Dynamic Module Loading:

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@9aoy 9aoy marked this pull request as draft April 14, 2025 11:08
@9aoy 9aoy marked this pull request as ready for review April 18, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant