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

Add middleware redirection in vite #2686

Merged
merged 3 commits into from
Nov 14, 2024
Merged

Add middleware redirection in vite #2686

merged 3 commits into from
Nov 14, 2024

Conversation

ildyria
Copy link
Member

@ildyria ildyria commented Nov 14, 2024

support for multiple / end-points so that F5 no longer fails when doing local dev with npm only (using VITE_LOCAL_DEV and VITE_HTTP_PROXY_TARGET)

@ildyria ildyria added the Review: easy Easy review expected: probably just need a quick to go through. label Nov 14, 2024
@ildyria ildyria added this to the 6.1.0 milestone Nov 14, 2024
@ildyria ildyria requested a review from d7415 November 14, 2024 08:30
Copy link

codecov bot commented Nov 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.82%. Comparing base (f6a72dd) to head (219e024).
Report is 5 commits behind head on master.

Additional details and impacted files

const localDevelopMiddleware: PluginOption = {
name: "develop-rewrite-middleware",
configureServer(server) {
const viteIndexPath = "/vite/index.html";
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess if it's local we don't need subpath handling.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes.
in this specific case when you do npm run dev it is poping an server and redirecting you to http://localhost:5173/vite/index.html which we use to load the app.ts

return;
}

console.log(req.url);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want the debug code?

Copy link
Member Author

Choose a reason for hiding this comment

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

better safe on that one, it will only be visible if using local dev without the composer part.

vite.config.ts Outdated Show resolved Hide resolved
Co-authored-by: Martin Stone <1611702+d7415@users.noreply.github.com>
@ildyria ildyria merged commit 5bed17c into master Nov 14, 2024
49 checks passed
@ildyria ildyria deleted the vite-local-dev branch November 14, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review: easy Easy review expected: probably just need a quick to go through.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants