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)

Most upvoted comments

No worries, let me know if & how you run into problems.

On Sat, Aug 21, 2021 at 1:59 PM Kadir Yazıcı @.***> wrote:

I used vite-plugin-ssr but not @vitejs/plugin-legacy I just saw this issue and wanted to send a comment. And I’m sorry for commenting before using it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/brillout/vite-plugin-ssr/issues/39#issuecomment-903105773, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHVQRT3E4OECKACZETGN5LT56IIRANCNFSM422AXDDQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

@brillout Government 😀

@brillout @vitejs/plugin-legacy does not add just IE 11 support. It adds es modules support for browsers those don’t support it.

For example vue@3 uses Proxy, proxies are available in Chrome 49+ but es modules are available in Chrome 60+. That is huge actually and latest chrome version of windows xp is 49.

Vite SSR had the same problem, what it does now is it compiles ONLY client files with @vitejs/plugin-legacy See

Had a closer look; the legacy plugin doesn’t support SSR (its HTML transformer assumes that the HTML is rendered at build-time). vite-plugin-ssr could 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?