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

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

Merged
pi0 merged 1 commit intomainfrom
fix/vite-relative
Aug 15, 2022
Merged

fix(vite): pass relative url as default base#6637
pi0 merged 1 commit intomainfrom
fix/vite-relative

Conversation

@danielroe
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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