Skip to content
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

Handle loading symlinked config files #3783

Merged
merged 1 commit into from Sep 17, 2020
Merged

Conversation

lukastaegert
Copy link
Member

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

List any relevant issue numbers:
Resolves #3781

Description

The reason at its core here is that when using require.cache to intercept module loading and requiring a symlink, the filename in the cache will always be the symlink target (i.e. a symlink is treated as the symlinked file by Node). This was already handled when specifying an explicit file name but the logic was missing for the default file names. This is fixed now.

@rollup-bot
Copy link
Collaborator

rollup-bot commented Sep 17, 2020

Thank you for your contribution! ❤️

You can try out this pull request locally by installing Rollup via

npm install rollup/rollup#gh-3781-symlinked-config

or load it into the REPL:
https://rollupjs.org/repl/?circleci=12957

@codecov
Copy link

codecov bot commented Sep 17, 2020

Codecov Report

Merging #3783 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3783   +/-   ##
=======================================
  Coverage   97.03%   97.03%           
=======================================
  Files         185      185           
  Lines        6466     6467    +1     
  Branches     1875     1875           
=======================================
+ Hits         6274     6275    +1     
  Misses        101      101           
  Partials       91       91           
Impacted Files Coverage Δ
cli/run/getConfigPath.ts 89.47% <100.00%> (ø)
cli/run/loadConfigFile.ts 95.65% <100.00%> (+0.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c512305...eda8db8. Read the comment docs.

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 -c fails if rollup.config.js is a symlink
2 participants