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

fix(vite): pass relative url as default base #6637

Merged
merged 1 commit into from
Aug 15, 2022
Merged

fix(vite): pass relative url as default base #6637

merged 1 commit into from
Aug 15, 2022

Conversation

danielroe
Copy link
Member

πŸ”— Linked issue

resolves nuxt/nuxt#14564

❓ 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

Interestingly, vite does not always use renderBuiltUrl but sometimes checks .base by itself. This sets a relative base as the default, which will mean that vite-inserted link preloads will point to the correct location with a dynamic base.

πŸ“ Checklist

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

@danielroe danielroe added bug Something isn't working vite πŸ”¨ p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage labels Aug 15, 2022
@danielroe danielroe requested a review from pi0 August 15, 2022 12:58
@danielroe danielroe self-assigned this Aug 15, 2022
@netlify
Copy link

netlify bot commented Aug 15, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

Name Link
πŸ”¨ Latest commit 0700e56
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/62fa42fa57439500083f831b

@pi0
Copy link
Member

pi0 commented Aug 15, 2022

LGTM. Shall we only make a reproduction to report in upstream for handling unhandled cases for renderBuiltUrl or is it impossible in some?

@pi0 pi0 merged commit 385fa60 into main Aug 15, 2022
@pi0 pi0 deleted the fix/vite-relative branch August 15, 2022 13:10
@danielroe
Copy link
Member Author

~> vitejs/vite#9680

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 πŸ”¨ p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage vite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

After adding onMounted in App.vue, the href of modulepreload has no baseURL prefix
2 participants