{data.allMyRemoteImage.nodes.map(node => {
@@ -54,6 +54,7 @@ const RemoteFile = ({ data }) => {
)
})}
+ {JSON.stringify(serverData, null, 2)}
)
}
@@ -65,8 +66,7 @@ export const pageQuery = graphql`
id
url
filename
- # FILE_CDN is not supported in SSR/DSG yet
- # publicUrl
+ publicUrl
resize(width: 100) {
height
width
@@ -75,23 +75,17 @@ export const pageQuery = graphql`
fixed: gatsbyImage(
layout: FIXED
width: 100
- # only NONE placeholder is supported in SSR/DSG
- # placeholder: DOMINANT_COLOR
- placeholder: NONE
+ placeholder: DOMINANT_COLOR
)
constrained: gatsbyImage(
layout: CONSTRAINED
width: 300
- # only NONE placeholder is supported in SSR/DSG
- # placeholder: DOMINANT_COLOR
- placeholder: NONE
+ placeholder: BLURRED
)
constrained_traced: gatsbyImage(
layout: CONSTRAINED
width: 300
- # only NONE placeholder is supported in SSR/DSG
- # placeholder: DOMINANT_COLOR
- placeholder: NONE
+ placeholder: TRACED_SVG
)
full: gatsbyImage(layout: FULL_WIDTH, width: 500, placeholder: NONE)
}
@@ -109,3 +103,11 @@ export const pageQuery = graphql`
`
export default RemoteFile
+
+export function getServerData() {
+ return {
+ props: {
+ ssr: true,
+ },
+ }
+}
diff --git a/packages/gatsby-adapter-netlify/src/file-cdn-url-generator.ts b/packages/gatsby-adapter-netlify/src/file-cdn-url-generator.ts
index f24efd9c8281c..4cb22b0fa07f6 100644
--- a/packages/gatsby-adapter-netlify/src/file-cdn-url-generator.ts
+++ b/packages/gatsby-adapter-netlify/src/file-cdn-url-generator.ts
@@ -1,4 +1,4 @@
-import crypto from "crypto"
+import { createHash } from "crypto"
import { basename } from "path"
import type { FileCdnUrlGeneratorFn, FileCdnSourceImage } from "gatsby"
@@ -21,8 +21,7 @@ export const generateFileUrl: FileCdnUrlGeneratorFn = function generateFileUrl(
baseURL.searchParams.append(`cd`, source.internal.contentDigest)
} else {
baseURL = new URL(
- `${placeholderOrigin}${pathPrefix}/_gatsby/file/${crypto
- .createHash(`md5`)
+ `${placeholderOrigin}${pathPrefix}/_gatsby/file/${createHash(`md5`)
.update(source.url)
.digest(`hex`)}/${basename(source.filename)}`
)
diff --git a/packages/gatsby/src/schema/graphql-engine/bundle-webpack.ts b/packages/gatsby/src/schema/graphql-engine/bundle-webpack.ts
index 4b87d2e5115a9..bf73d6021cdd3 100644
--- a/packages/gatsby/src/schema/graphql-engine/bundle-webpack.ts
+++ b/packages/gatsby/src/schema/graphql-engine/bundle-webpack.ts
@@ -129,6 +129,11 @@ export async function createGraphqlEngineBundle(
reporter: Reporter,
isVerbose?: boolean
): Promise