Skip to content

fix(commonjs): crawl dynamicRequireRoot outside cwd#1859

Merged
lukastaegert merged 2 commits intorollup:masterfrom
ambarvm:fix/dynamic-require-root-outside-cwd
Jun 14, 2025
Merged

fix(commonjs): crawl dynamicRequireRoot outside cwd#1859
lukastaegert merged 2 commits intorollup:masterfrom
ambarvm:fix/dynamic-require-root-outside-cwd

Conversation

@ambarvm
Copy link
Contributor

@ambarvm ambarvm commented Apr 5, 2025

Rollup Plugin Name: {commonjs}

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.

List any relevant issue numbers:

resolves #1855

Description

After switching to fdir for globbing, it was no longer possible to have dynamicRequireTargets outside cwd as fdir only crawls cwd by default. dynamicRequireTargets outside cwd is often required when using npm workspaces as packages are hoisted to the node_modules in workspace root.
dynamicRequireRoot is passed to fdir's crawl() to fix this.

Copy link
Member

@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks a lot!

@lukastaegert lukastaegert merged commit ff4c928 into rollup:master Jun 14, 2025
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.

[@rollup/plugin-commonjs] no way to use path outside current dir in dynamicRequireTargets

2 participants