Skip to content
This repository was archived by the owner on Apr 9, 2020. It is now read-only.
This repository was archived by the owner on Apr 9, 2020. It is now read-only.

addImport() is deprecated in Babel 7 #110

@joshparolin

Description

@joshparolin

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:

const transformImportId = this.file.addImport(transformName, 'default', transformName);

Case 2:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions