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

Backport code from @vitejs/plugin-legacy to vite_plugin_legacy #296

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Antti
Copy link

@Antti Antti commented Nov 3, 2022

Description 📖

Backport most of the logic from @vitejs/plugin-legacy to vite_plugin_legacy

This is currently used in production for over a year to support a wide variety of legacy browsers.

Background 📜

@vitejs/plugin-legacy does a lot of magic to support legacy browsers by rewriting index.html,
we're mostly interested in:

  • Safari 10 nomodule fix
  • A workaround for browsers that support modules, but do not support dynamic import:
    • script has type module, so only browsers which support modules would load it
    • if the dynamic import works - nothing happens
    • if the dynamic import fails - loads polyfills legacy
    • when polyfills legacy is loaded - it will then execute the entrypoint

@alexookah
Copy link

@ElMassimo Can we review and merge this?

@ElMassimo ElMassimo force-pushed the main branch 2 times, most recently from d55cc92 to ebe50b8 Compare July 17, 2024 14:43
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.

2 participants