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

fix(vite): skip _only_ vite transform middleware #9602

Merged
merged 1 commit into from
Dec 12, 2022
Merged

fix(vite): skip _only_ vite transform middleware #9602

merged 1 commit into from
Dec 12, 2022

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented Dec 8, 2022

πŸ”— Linked issue

resolves nuxt/nuxt#15559, resolves nuxt/nuxt#15735, resolves nuxt/nuxt#15510

❓ 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

This PR avoids modifying the URL for vite middleware injected prior to viteTransformMiddleware, instead injecting another middleware to make the modification within the vite stack.

The underlying mechanism of skipping the vite transform hasn't changed, just the time of making the change.

cc: @patak-dev

πŸ“ Checklist

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

@danielroe danielroe added bug Something isn't working vite labels Dec 8, 2022
@danielroe danielroe requested a review from pi0 December 8, 2022 15:39
@danielroe danielroe self-assigned this Dec 8, 2022
@codesandbox
Copy link

codesandbox bot commented Dec 8, 2022

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

@patak-dev
Copy link

For reference, the function name viteTransformMiddleware is part of Vite's public API and won't be changed except for a breaking change in a Major.

Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

LGTM. Couldn't find a better solution.

@pi0 pi0 merged commit 050c6df into main Dec 12, 2022
@pi0 pi0 deleted the fix/vite-url branch December 12, 2022 11:45
@pi0 pi0 mentioned this pull request Dec 15, 2022
6 tasks
@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe mentioned this pull request Jan 20, 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 vite
Projects
None yet
3 participants