-
-
Notifications
You must be signed in to change notification settings - Fork 451
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
wip: include dynamic import automatically #714
Conversation
I'd prefer that we enable it based on |
@nicolo-ribaudo: I'm not familiar with this part of the code yet and may be misreading you here. Are you suggesting to move this change to |
Yes, but I'm not 100% sure about it so lets wait for someone else's opinion.
I think that we should do this in any case, though. |
Yes we introduced that flag to add this functionality, it's from #660 |
Am I right to understand that https://github.com/babel/babel-loader/blob/7d8500c/src/injectCaller.js#L13 means that |
@thiagoarrais yeah you're correct. I actually have a branch with the behavior enabled, but need to dig back into my notes on something I ran into (or some decision that needed to be made) |
I added The main issue in my mind is that it seems surprising to automatically parse this syntax only when running in Webpack and not other contexts when it isn't standard yet. Once we get to the point of it being opt-in, I'm not sure it is clear why we'd go that route instead of expecting people to enable the syntax plugin manually. |
I will go on and try to implement this in preset-env as a learning exercise. We can later decide on merging it or not. @existentialism: if you happen to find that branch, please let me know. @loganfsmyth: I agree that it is surprising. But as I understand, that was exactly the intended behavior described in the original issue (#515). The project understanding can change, of course. Maybe the OP (@hzoo) can weigh in here? Closing the PR for now to signal that I won't work on this change any longer. Please do keep the discussion going. |
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
What is the current behavior? (You can also link to an open issue here)
This fixes #515 . The dynamic import syntax plugin has to be manually added to webpack config even though webpack itself already supports dynamic imports.
What is the new behavior?
Dynamic import syntax is automatically supported.
Does this PR introduce a breaking change?
Other information:
Please let me know if and where I should add docs/tests.