Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

fix(kit): use pathe to resolve aliases #8453

Merged
merged 2 commits into from Oct 25, 2022
Merged

fix(kit): use pathe to resolve aliases #8453

merged 2 commits into from Oct 25, 2022

Conversation

danielroe
Copy link
Member

πŸ”— Linked issue

resolves nuxt/nuxt#14735

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

We have some upstream fixes in pathe/utils that we can take advantage of in kit.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroe danielroe added bug Something isn't working kit πŸ”¨ p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage labels Oct 25, 2022
@danielroe danielroe requested a review from pi0 October 25, 2022 06:32
@danielroe danielroe self-assigned this Oct 25, 2022
@codesandbox
Copy link

codesandbox bot commented Oct 25, 2022

CodeSandbox logoCodeSandbox logoΒ  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@netlify
Copy link

netlify bot commented Oct 25, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

Name Link
πŸ”¨ Latest commit f70ee81
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/63578e0ac64ad30009c945b2

@@ -106,13 +106,7 @@ export function resolveAlias (path: string, alias?: Record<string, string>): str
if (!alias) {
alias = tryUseNuxt()?.options.alias || {}
}
for (const key in normalizeAliases(alias)) {
if (key === '@' && !path.startsWith('@/')) { continue } // Don't resolve @foo/bar
Copy link
Member

Choose a reason for hiding this comment

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

Note that we have removed @ and @/ check from pathe util

Copy link
Member Author

Choose a reason for hiding this comment

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

But we now respect path separate which should do the same thing.

@pi0 pi0 merged commit 54da6f8 into main Oct 25, 2022
@pi0 pi0 deleted the fix/pathe-resolve-alias branch October 25, 2022 08:24
@pi0 pi0 mentioned this pull request Nov 3, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3.x bug Something isn't working kit πŸ”¨ p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[kit] resolveAlias should sort keys by length first
3 participants