-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Should subpath mapping/pattern support conditions? #1
Comments
Oh interesting. I'd never seen this but agree that it makes sense. Just confirmed that it works in Node.js too (12.18, 14.15 – but not 12.14), so I think it was intended. |
This is the only blocker for Vite to switch to use this package - great job! |
Conditions were aways supported for subpath folders. v12.17.0 was the version of 12.x where we unflagged ESM, as such it can be expected that if you are using ESM unflagged today subpath folder mapping with conditions will be supported. That said we have deprecated subpath folder mapping encouraging developers to instead use subpath patterns, which can do everything that subpath folder mapping can do and more. Subpath patterns landed in v12.20.0 and v14.13.0. |
* fix: support conditions in directory mapping; - Closes #1 * chore: update module size
Thank you Myles :) Both are supported here, just to make it easy. The bit for subpath folder mapping is easy to remove at a later date. With that confirmation, I went ahead and added this missing piece. Will publish a patch version now. |
# 1.0.0 (2023-01-01) ### Bug Fixes * allow conditions in directory mapping ([lukeed#2](https://github.com/okikio/resolve.imports/issues/2)) ([a881ef8](a881ef8)), closes [lukeed#1](https://github.com/okikio/resolve.imports/issues/1) * check subpattern length correctly; ([81ae07a](81ae07a)), closes [lukeed#4](https://github.com/okikio/resolve.imports/issues/4) * consolidate `Set` initializer ([9daed2a](9daed2a)) * ignore "import" condition when `requires` enabled ([dcff185](dcff185)) * tests ([567fde6](567fde6)) * tests ([758b7b5](758b7b5)) * throw "no conditions" error ([0fe321b](0fe321b)) ### Features * add `legacy` method for non-exports fields ([ce7ca85](ce7ca85)) * add `unsafe` option ([lukeed#13](https://github.com/okikio/resolve.imports/issues/13)) ([0b69d12](0b69d12)) * directory/subpath mapping; ([9e66106](9e66106)) * handle "browser" files object ([a1374ea](a1374ea)) * support mixed path/conditions (array) ([f74e3c5](f74e3c5)) * **types:** allow `readonly` and `const` arrays in options ([lukeed#15](https://github.com/okikio/resolve.imports/issues/15)) ([587b0ba](587b0ba))
# 1.0.0 (2023-01-01) ### Bug Fixes * allow conditions in directory mapping ([lukeed#2](https://github.com/okikio/resolve.imports/issues/2)) ([a881ef8](a881ef8)), closes [lukeed#1](https://github.com/okikio/resolve.imports/issues/1) * check subpattern length correctly; ([81ae07a](81ae07a)), closes [lukeed#4](https://github.com/okikio/resolve.imports/issues/4) * consolidate `Set` initializer ([9daed2a](9daed2a)) * forgot to make pkg public ([3fa0663](3fa0663)) * ignore "import" condition when `requires` enabled ([dcff185](dcff185)) * tests ([567fde6](567fde6)) * tests ([758b7b5](758b7b5)) * throw "no conditions" error ([0fe321b](0fe321b)) ### Features * add `legacy` method for non-exports fields ([ce7ca85](ce7ca85)) * add `unsafe` option ([lukeed#13](https://github.com/okikio/resolve.imports/issues/13)) ([0b69d12](0b69d12)) * directory/subpath mapping; ([9e66106](9e66106)) * fork resolve.exports into resolve.imports for resolving subpath imports ([bd505cd](bd505cd)) * generate changelog ([bc66266](bc66266)) * handle "browser" files object ([a1374ea](a1374ea)) * support mixed path/conditions (array) ([f74e3c5](f74e3c5)) * **types:** allow `readonly` and `const` arrays in options ([lukeed#15](https://github.com/okikio/resolve.imports/issues/15)) ([587b0ba](587b0ba))
Example:
The docs doesn't really specify this, but I think it makes sense. /cc @MylesBorins
The text was updated successfully, but these errors were encountered: