From 730c7ca410b3baa8f7e2e20224c8267c8df6a0bb Mon Sep 17 00:00:00 2001 From: "Stanislav S. Yarmonov" Date: Tue, 17 Dec 2019 17:19:45 +0200 Subject: [PATCH] chore(gatsby-plugin-mdx): refactored to use createContentDigest (#8805) (#19885) * gatsby-plugin-mdx refactored to use createContentDigest (#8805) * createContentDigest usage simplified for gatsby-plugin-mdx (#8805) --- packages/gatsby-plugin-mdx/utils/create-mdx-node.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/gatsby-plugin-mdx/utils/create-mdx-node.js b/packages/gatsby-plugin-mdx/utils/create-mdx-node.js index 7a8fbda75389e..1071f9dbad46a 100644 --- a/packages/gatsby-plugin-mdx/utils/create-mdx-node.js +++ b/packages/gatsby-plugin-mdx/utils/create-mdx-node.js @@ -1,4 +1,5 @@ -const crypto = require(`crypto`) +const { createContentDigest } = require(`gatsby-core-utils`) + const mdx = require(`../utils/mdx`) const extractExports = require(`../utils/extract-exports`) @@ -39,10 +40,7 @@ module.exports = async ({ id, node, content }) => { mdxNode.fileAbsolutePath = node.absolutePath } - mdxNode.internal.contentDigest = crypto - .createHash(`md5`) - .update(JSON.stringify(mdxNode)) - .digest(`hex`) + mdxNode.internal.contentDigest = createContentDigest(mdxNode) return mdxNode }