-
-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(resolver): add a
realpath
to package.json (#1634)
Using the `realpath` for resolving browser field will lead to missing queries. This fixes a cases where `browserField` fails to read. --- `styled-components` is using a trick for loading browser modules: --- https://github.com/styled-components/styled-components/blob/7c065e0b6f890760d7a6759ec5e4a95775b6e688/packages/styled-components/package.json#L6C1-L12C5 ```json "main": "dist/styled-components.cjs.js", "module": "./dist/styled-components.esm.js", "browser": { "./dist/styled-components.esm.js": "./dist/styled-components.browser.esm.js", "./dist/styled-components.cjs.js": "./dist/styled-components.browser.cjs.js" }, ``` Module resolution has to go from `"module": "./dist/styled-components.esm.js"`, then to `browser`'s `"./dist/styled-components.esm.js": "./dist/styled-components.browser.esm.js"` part in order for things to get resolved correctly. --- Fixtures are hard to setup for this test case due to needing symlinks, I've created https://github.com/oxc-project/oxc_resolver for tacking such cases.
- Loading branch information
Showing
3 changed files
with
21 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters