diff --git a/packages/gatsby-source-contentful/package.json b/packages/gatsby-source-contentful/package.json index 6d16fdb432471..d5ad72bd5ac9b 100644 --- a/packages/gatsby-source-contentful/package.json +++ b/packages/gatsby-source-contentful/package.json @@ -18,7 +18,6 @@ "contentful": "^8.1.7", "fs-extra": "^9.1.0", "gatsby-core-utils": "^2.3.0-next.0", - "gatsby-plugin-image": "^1.3.0-next.1", "gatsby-plugin-utils": "^1.3.0-next.0", "gatsby-source-filesystem": "^3.3.0-next.0", "is-online": "^8.5.1", @@ -45,6 +44,7 @@ "license": "MIT", "peerDependencies": { "gatsby": "^3.0.0-next.0", + "gatsby-plugin-image": "^1.3.0-next.1", "gatsby-plugin-sharp": "^3.0.0-next.0", "sharp": "^0.26.0" }, diff --git a/packages/gatsby-source-contentful/src/extend-node-type.js b/packages/gatsby-source-contentful/src/extend-node-type.js index ca87598d2ab1c..fb7b2ab28a6f8 100644 --- a/packages/gatsby-source-contentful/src/extend-node-type.js +++ b/packages/gatsby-source-contentful/src/extend-node-type.js @@ -15,10 +15,6 @@ const { GraphQLList, } = require(`gatsby/graphql`) const qs = require(`qs`) -const { generateImageData } = require(`gatsby-plugin-image`) -const { - getGatsbyImageFieldConfig, -} = require(`gatsby-plugin-image/graphql-utils`) const { stripIndent } = require(`common-tags`) const cacheImage = require(`./cache-image`) @@ -720,6 +716,8 @@ exports.extendNodeType = ({ type, store }) => { const resolveGatsbyImageData = async (image, options) => { if (!isImage(image)) return null + const { generateImageData } = require(`gatsby-plugin-image`) + const { baseUrl, contentType, width, height } = getBasicImageProps( image, options @@ -773,6 +771,10 @@ exports.extendNodeType = ({ type, store }) => { // gatsby-plugin-image const getGatsbyImageData = () => { + const { + getGatsbyImageFieldConfig, + } = require(`gatsby-plugin-image/graphql-utils`) + const fieldConfig = getGatsbyImageFieldConfig(resolveGatsbyImageData, { jpegProgressive: { type: GraphQLBoolean,