Fix binding access for plugin-transform-typescript (#13900)

This commit is contained in:
Peach 2021-10-31 01:54:42 +08:00 committed by GitHub
parent 07d1a8008e
commit c20506e594
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -305,9 +305,8 @@ export default declare((api: ConfigAPI, opts: Options): Plugin => {
// just bail if there is no binding, since chances are good that if // just bail if there is no binding, since chances are good that if
// the import statement was injected then it wasn't a typescript type // the import statement was injected then it wasn't a typescript type
// import anyway. // import anyway.
if (!importsToRemove.has(binding.path)) { if (binding && !importsToRemove.has(binding.path)) {
if ( if (
binding &&
isImportTypeOnly({ isImportTypeOnly({
binding, binding,
programPath: path, programPath: path,