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

[Explanation] In production, vite-plugin-ssr doesn't load vite.config.js #402

Closed
brillout opened this issue Aug 3, 2022 · 0 comments
Closed

Comments

@brillout
Copy link
Member

brillout commented Aug 3, 2022

⚠️ This only applies to SSR apps. If you use SSG you can ignore this.

Vite isn't loaded in production

In production, Vite isn't loaded at all. Because loading Vite and all your Vite plugins would considerably bloat your production server.

On a high-level, Vite really only is a development tool. So it makes sense to not load Vite in production.

Also, in restrictive environments such as on the edge (Cloudflare Workers, Deno Deploy, ...) we actually cannot load Vite.

Consequences

This has several consequences:

  • Vite plugins that transform HTML cannot be applied in production. See [Workarounds] HTML transformers not applied for SSR apps #224.
  • vite.config.js isn't loaded and therefore none of its configuration is available in production. (But that's usually ok since Vite configs are usually only about configuring dev & build.)
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

No branches or pull requests

1 participant