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

fix(npm): canonicalize filename before returning #18948

Merged
merged 6 commits into from May 2, 2023

Conversation

bartlomieju
Copy link
Member

This commit changes how paths for npm packages are handled,
by canonicalizing them when resolving. This is done so that instead
of returning "node_modules/<package_name>@/node_modules//index.js"
(which is a symlink) we "node_modules/@<dep_version>/index.js.

Fixes #18924
Fixes bluwy/create-vite-extra#31

@bartlomieju bartlomieju requested a review from dsherret May 1, 2023 22:42
cli/npm/resolvers/local.rs Outdated Show resolved Hide resolved
cli/tests/integration/npm_tests.rs Show resolved Hide resolved
@bartlomieju bartlomieju requested a review from dsherret May 1, 2023 22:50
@bartlomieju bartlomieju mentioned this pull request May 1, 2023
4 tasks
Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for fixing this.

@bartlomieju bartlomieju merged commit 2f651b2 into denoland:main May 2, 2023
11 checks passed
@bartlomieju bartlomieju deleted the npm_canonicalize branch May 2, 2023 00:35
levex pushed a commit that referenced this pull request May 4, 2023
This commit changes how paths for npm packages are handled,
by canonicalizing them when resolving. This is done so that instead
of returning
"node_modules/<package_name>@<version>/node_modules/<dep>/index.js"
(which is a symlink) we "node_modules/<dep>@<dep_version>/index.js.

Fixes #18924
Fixes bluwy/create-vite-extra#31

---------

Co-authored-by: David Sherret <dsherret@gmail.com>
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.

[npm] Non-canonicalized referrer causing module resolution errors Vite Deno templates do not work
2 participants