-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Dynamic import transform #9551
Copy link
Copy link
Closed
Labels
outdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue
Metadata
Metadata
Assignees
Labels
outdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue
We currently only support parsing of
import(foo), and ask people to use wither webpack orbabel-plugin-dynamic-import-nodeto transpile it.I think that we can easily add it to
@babel/plugin-transform-modules-*(or create new@babel/plugin-proposal-dynamic-import-*packages):My preference would be to add this feature (behind an option) to the existing plugins, since we can't transpile
import()without also transpiling es6import/export.If you prefer the separte plugins, we could add an "internal option" to
@babel/plugin-transform-modules-*which is enabled by@babel/plugin-proposal-dynamic-import. If the modules plugin is not enabled,@babel/plugin-proposal-dynamic-importwould throw an error.