vike: Can't get @vitejs/plugin-legacy working
Me again 😅
I (think) I can’t get @vitejs/plugin-legacy working properly, I’ve set up helmet for express to generate the Content-Security-Policy headers for the script hashes and it’s generating the legacy bundles, but I think it’s not actually referencing anything in my html not in <head/> nor in <body/>
My vite.config.js plugins looks like this
plugins: [legacy(), reactRefresh(), ssr()],
Also tried different ordering just to make sure.
Do I have to include anything in my _default.page.server.tsx manually?
I guess it’s due to vite-plugin-ssr not using Vites static index.html file 🤔
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 18 (12 by maintainers)
No worries, let me know if & how you run into problems.
On Sat, Aug 21, 2021 at 1:59 PM Kadir Yazıcı @.***> wrote:
@brillout Government 😀
@brillout @vitejs/plugin-legacy does not add just IE 11 support. It adds
es modulessupport for browsers those don’t support it.For example
vue@3usesProxy, proxies are available inChrome 49+butes modulesare available inChrome 60+. That is huge actually and latest chrome version ofwindows xpis49.Vite SSR had the same problem, what it does now is it compiles
ONLYclient files with@vitejs/plugin-legacySeeHad a closer look; the legacy plugin doesn’t support SSR (its HTML transformer assumes that the HTML is rendered at build-time).
vite-plugin-ssrcould apply the required HTML changes itself, but it would require time to implement. AFAICT I don’t see it to be worth it as the JS ecosystem is increasingly dropping IE11 support. For example IIRC Vue 3 won’t support IE 11.Do you really need IE 11 support?