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

change req to resolve based on file path rather than directory #231

Merged
merged 1 commit into from
Feb 11, 2022

Conversation

43081j
Copy link
Contributor

@43081j 43081j commented Feb 11, 2022

We previously had a fabricated file name (_) to forcefully resolve a
given directory path to a file path, so createRequire would be happy.

Since we now pass the file path every time, we no longer need this.

In future, if we need to req a directory, we should resolve the path
at the call-site rather than inside req.

Type

  • Fix

SemVer

  • Fix (:label: Patch)

Issues

Fixes the problems mentioned in #229.


@ai we really should add some tests for the various ways things can be resolved. could you help with that some time as i dont fully follow what is tested where yet.

basically some tests (if they dont exist already) to ensure we can have various types of paths to plugins (relative, absolute, etc).

We previously had a fabricated file name (`_`) to forcefully resolve a
given directory path to a file path, so `createRequire` would be happy.

Since we now pass the file path every time, we no longer need this.

In future, if we need to `req` a directory, we should resolve the path
at the call-site rather than inside `req`.
@ai ai merged commit fa6003c into postcss:main Feb 11, 2022
@43081j 43081j deleted the req-file-paths branch February 11, 2022 13:49
mojavelinux added a commit to mojavelinux/postcss-load-config that referenced this pull request Feb 12, 2022
ai pushed a commit that referenced this pull request Feb 12, 2022
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.

2 participants