postcss / postcss-load-config

Autoload Config for PostCSS
MIT License
638 stars 71 forks source link

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

Closed 43081j closed 2 years ago

43081j commented 2 years ago

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

SemVer

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).