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

Help users that visit the Vite dev server directly #57

Merged
merged 5 commits into from
Jul 5, 2022

Conversation

jessarcher
Copy link
Member

@jessarcher jessarcher commented Jul 3, 2022

This is intended to help developers that visit the Vite dev server directly by following the link that Vite outputs to the console.

It injects content into the index.html page that Vite serves and outputs a warning to the console.

Console
Note: this only appears when the index.html page is requested
image

Browser (light mode)
image

Browser (dark mode)
image

Using APP_URL is a little problematic as it's not guaranteed to be correct. I'm hoping it's better than nothing though.

Fixes #40

@jessarcher jessarcher marked this pull request as ready for review July 4, 2022 06:15
Copy link
Member

@timacdonald timacdonald left a comment

Choose a reason for hiding this comment

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

Absolutely gorgeous solution 🤩 Tested and working great on my end.

src/index.ts Outdated Show resolved Hide resolved
Co-authored-by: Tim MacDonald <hello@timacdonald.me>
@taylorotwell taylorotwell merged commit 511ee49 into main Jul 5, 2022
@taylorotwell taylorotwell deleted the dev-server-index-help branch July 5, 2022 19:43
timacdonald added a commit that referenced this pull request Jul 14, 2022
* Help users that visit the Vite dev server directly

* send 404 response status

* Update console wording

Co-authored-by: Tim MacDonald <hello@timacdonald.me>

* Formatting

* Update dev-server-index.html

Co-authored-by: Tim MacDonald <hello@timacdonald.me>
Co-authored-by: Taylor Otwell <taylor@laravel.com>
ElMassimo added a commit to ElMassimo/vite_ruby that referenced this pull request Mar 16, 2023
ElMassimo added a commit to ElMassimo/vite_ruby that referenced this pull request Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Guide users away from attempting to load the dev server url to access site
3 participants