镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

fix(commonjs): crawl dynamicRequireRoot outside cwd - #1859

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

lukastaegert merged 2 commits into
rollup:masterfrom
ambarvm:fix/dynamic-require-root-outside-cwd

Conversation

@ambarvm

@ambarvm ambarvm commented Apr 5, 2025 •

Copy link
Copy Markdown
Contributor

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.

@lukastaegert lukastaegert left a comment

Copy link
Copy Markdown
Member

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