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

feat(vite): detect app behind frontend server #408

Closed
wants to merge 8 commits into from

Conversation

userquin
Copy link
Member

@userquin userquin commented Jan 4, 2022

This PR allows enable the UnoCSS plugin for global model when the Vite application is behind a frontend server, also on dev mode: for example using PHP + Laravel + Inertia.

I added also a custom server configuration, I don't know if this makes sense, but @chuoke request it on the disccusion linked bellow.

For context see:

@userquin userquin requested a review from antfu as a code owner January 4, 2022 15:54
@netlify
Copy link

netlify bot commented Jan 4, 2022

✔️ Deploy Preview for ecstatic-mestorf-2e8afd ready!

🔨 Explore the source changes: 5e03185

🔍 Inspect the deploy log: https://app.netlify.com/sites/ecstatic-mestorf-2e8afd/deploys/61d854e95064fb0008d357fc

😎 Browse the preview: https://deploy-preview-408--ecstatic-mestorf-2e8afd.netlify.app

@antfu
Copy link
Member

antfu commented Jan 4, 2022

Could we somehow detect automatically (from vite config or client runtime) without introduce a separate option for that?

@userquin
Copy link
Member Author

userquin commented Jan 4, 2022

I'm editing the file to inline the configuration using the vite types...

@userquin
Copy link
Member Author

userquin commented Jan 4, 2022

Could we somehow detect automatically (from vite config or client runtime) without introduce a separate option for that?

The problem is we don't know if the app is behind a front end, so, how we can detect that without any hint from the use land?

@userquin
Copy link
Member Author

userquin commented Jan 4, 2022

For example, I use apache + dev server, the vite app cannot infer if apache is in front of it

@userquin
Copy link
Member Author

userquin commented Jan 4, 2022

we can include always the http(s)://<host>:<port> but the problem is the request mode, we can also include it always

@userquin userquin marked this pull request as draft January 4, 2022 16:30
@userquin
Copy link
Member Author

userquin commented Jan 4, 2022

changing logic to include it on the client side

@userquin userquin changed the title feat(vite): add frontend support for global mode feat(vite): detect app behind frontend server Jan 4, 2022
@userquin userquin marked this pull request as ready for review January 4, 2022 16:58
@userquin
Copy link
Member Author

userquin commented Jan 4, 2022

@chuoke with the new approach, you don't need to add anything on the plugin configuration, we added the logic to detect automatically on the client side

@userquin userquin marked this pull request as draft January 5, 2022 10:03
@userquin userquin marked this pull request as ready for review January 5, 2022 18:11
@hunteryun
Copy link

Uh, I've been watching (waiting) this, wondering what's going on right now? Are you preparing for a better plan? Can anyone reveal some plans?

呃,我一直在关注(等待)这个,不知道现在是怎么情况?是在准备更好的方案吗?谁能透露一些计划吗?

@antfu antfu closed this in 3e0e8e8 Feb 8, 2022
@ydcjeff ydcjeff deleted the userquin/feat-vite-frontend-option branch June 30, 2022 03:44
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.

None yet

3 participants