Skip to content

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