-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add additional information for plugin-syntax-dynamic-import #2197
base: main
Are you sure you want to change the base?
Conversation
Deploy preview for babel ready! Built with commit 445887e |
Deploy preview for babel ready! Built with commit ae63fba |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
website/versioned_docs/version-6.26.3/plugin-syntax-dynamic-import.md
Outdated
Show resolved
Hide resolved
website/versioned_docs/version-7.4.0/plugin-syntax-dynamic-import.md
Outdated
Show resolved
Hide resolved
website/versioned_docs/version-7.0.0/plugin-syntax-dynamic-import.md
Outdated
Show resolved
Hide resolved
@nicolo-ribaudo @existentialism When you guys have a sec, I committed those suggestions. Thanks! |
@@ -5,6 +5,14 @@ sidebar_label: syntax-dynamic-import | |||
original_id: babel-plugin-syntax-dynamic-import | |||
--- | |||
|
|||
`babel-plugin-syntax-dynamic-import` is needed to enable support for parsing `import()` | |||
|
|||
**Usage notes:** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are using
babel-preset-env
, it's automatically handled
I don't think this applies for v6?
Otherwise, you need
babel-plugin-proposal-dynamic-import
babel-plugin-proposal-dynamic-import
doesn't exist :)
Should we link to https://github.com/airbnb/babel-plugin-dynamic-import-node?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😆 oops!
Yeah maybe something like:
Otherwise, consider using babel-plugin-dynamic-import-node.
@nicolo-ribaudo Just just verify, can you confirm that babel-preset-env (v6) does not automatically handle this? If not, I'll strike that line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, it's only supported in Babel 7 (7.5.0)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! I'll strike that line.
2. If you are using Webpack or Rollup, you shouldn't transpile `import()` with Babel and let the bundler handle it for you | ||
3. Otherwise, you need `@babel/plugin-proposal-dynamic-import` | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gunn4r Can you rebase on upstream? We have removed versioned_docs so I think only this section is required.
Adds addition context and information about what the plugin does and when to use it. Information is from @nicolo-ribaudo on slack: https://babeljs.slack.com/archives/C0DFJT81H/p1583965874176800