From c4ca9301f56b1ac15bf5219dbb33c661b13bbfcd Mon Sep 17 00:00:00 2001 From: LB Date: Wed, 3 Mar 2021 09:43:11 -0500 Subject: [PATCH] fix(gatsby-plugin-image): Use template from core package (#29957) * don't need template import * type it right --- .../src/babel-plugin-parse-static-images.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/gatsby-plugin-image/src/babel-plugin-parse-static-images.ts b/packages/gatsby-plugin-image/src/babel-plugin-parse-static-images.ts index ed2a18991a37d..642b69b5be1d9 100644 --- a/packages/gatsby-plugin-image/src/babel-plugin-parse-static-images.ts +++ b/packages/gatsby-plugin-image/src/babel-plugin-parse-static-images.ts @@ -1,11 +1,13 @@ -import * as types from "@babel/types" -import { PluginObj } from "@babel/core" +import type { + PluginObj, + template as BabelTemplate, + types as BabelTypes, +} from "@babel/core" import { hashOptions, evaluateImageAttributes } from "./babel-helpers" import fs from "fs-extra" import path from "path" import { slash } from "gatsby-core-utils" -import template from "@babel/template" import { stripIndent } from "common-tags" /** @@ -15,8 +17,10 @@ import { stripIndent } from "common-tags" export default function attrs({ types: t, + template, }: { - types: typeof types + types: typeof BabelTypes + template: typeof BabelTemplate }): PluginObj { return { visitor: {