-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Allow plugin-legacy to work for target with module support, but without dynamic import #3469
Comments
@nulladdict I think it would be good if you would like to create a PR for this, so we can discuss with Evan having this option in the table. About detecting dynamic import, we are already detecting it using eval here
This is the detection scheme from https://github.com/GoogleChromeLabs/dynamic-import-polyfill |
Sure thing, I'll see what I can come up with and submit a PR |
Hi, sorry for slacking on this I've put together a PoC #3885, but I'm not really happy with how it turned out. I also checked which browsers are affected (
To me, it looks like most of these apart from Edge and potentially Safari are auto-updatable, so the actual amount of affected users should be pretty low. Therefore it might be easier for users to upgrade than to have this feature implemented |
Clear and concise description of the problem
2.3.0
bumped default build targets to dynamic import support and removed polyfill, which introduced some challenges in supporting browsers with modules but without dynamic imports (like edge18 #3388)2.3.3
brought back the polyfill, but there are still some challenges present as described in this commentIt would be great, if legacy plugin allowed not polyfilling dynamic import (and subsequently not changing default build targets), but instead injected custom code before loading the main bundle, which would check support for the dynamic import, and load the fully-pollyfilled systemjs bundle in browsers, which support modules, but don't support the dynamic import
Suggested solution
Make legacy plugin do the following:
Alternative
Additional context
Seems like properly detecting dynamic import support requires eval, this worked for me in edge18:
The text was updated successfully, but these errors were encountered: