-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Do not strip flow import type declarations #12669
Comments
Hey @djvern! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite." |
You can skip the flow transform by replacing |
Ah, I tried that but import type declarations are still being stripped out. Is this just a default setting in Babel now? If so, how can I override it? |
Babel by default doesn't transform your code, you are unknowingly enabling the flow transform somewhere. You can post the output of |
Closing since this was a configuration problem. If you still need help feel free to ping. |
@nicolo-ribaudo thanks for the info - after a bit more investigating I realised the issue was with flow-runtime and the plugin babel-plugin-flow-runtime. There's a fix in the latest version which has resolved the issue if it helps anyone else: gajus/flow-runtime#254 |
The latest version of Babel 7 strips out flow
import type
declarations by default. They used to be included with earlier versions of Babel 7 and 6. Whilst it makes sense to remove them, is there an easy way to keep them and treat them as regular imports, as the app I'm working on uses flow-runtime and relies on the types to work.Is there an existing plugin that can do this, or do I need to write my own? At the moment I'm replacing
import type
withimport
as a build step before running babel, but if feels like there should be a way to do it all within Babel.The text was updated successfully, but these errors were encountered: