This repository was archived by the owner on Apr 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 86
addImport() is deprecated in Babel 7 #110
Copy link
Copy link
Open
Description
When trying to upgrade Babel 7, I experienced an error around the deprecation of addImport. Instead, the migration guide recommends using addDefault (reference: https://new.babeljs.io/docs/en/next/v7-migration-api.html#babel-core).
Error:
This API has been removed. If you're looking for this functionality in Babel 7, you should import the '@babel/helper-module-imports' module and use the functions exposed from that module, such as 'addNamed' or 'addDefault'.
Case 1:
babel-plugin-react-transform/src/index.js
Line 284 in ccd6dc1
| const transformImportId = this.file.addImport(transformName, 'default', transformName); |
Case 2:
babel-plugin-react-transform/src/index.js
Line 291 in ccd6dc1
| return this.file.addImport(importName, 'default', importName); |
I attempted to fork, but wound up spinning my wheels for too long. Any insight on how to best migrate would be much appreciated.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels