diff --git a/packages/gatsby-plugin-netlify-cms/src/gatsby-node.js b/packages/gatsby-plugin-netlify-cms/src/gatsby-node.js index 5b3f4c3d15d82..8498f7a19e8fb 100644 --- a/packages/gatsby-plugin-netlify-cms/src/gatsby-node.js +++ b/packages/gatsby-plugin-netlify-cms/src/gatsby-node.js @@ -160,7 +160,13 @@ exports.onCreateWebpackConfig = ( * config, they cause issues for our pre-bundled code. */ mode: stage === `develop` ? `development` : `production`, - optimization: {}, + optimization: { + /** + * Without this, node can get out of memory errors + * when building for production. + */ + minimizer: gatsbyConfig.optimization.minimizer, + }, devtool: stage === `develop` ? `cheap-module-source-map` : `source-map`, }