From 8dd2932080c9ae63ee287a865dde046fb25fdb4e Mon Sep 17 00:00:00 2001 From: Eduardo Nunes Date: Mon, 14 Jul 2025 08:41:31 +0100 Subject: [PATCH] fix webpack config --- gatsby-node.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/gatsby-node.js b/gatsby-node.js index ecd6e39..73f760a 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -6,17 +6,20 @@ const path = require("path"); -exports.onCreateWebpackConfig = ({ stage, actions }) => { - switch (stage) { - case `build-html`: +exports.onCreateWebpackConfig = ({ stage, actions, loaders }) => { + if (stage === `build-html`) { actions.setWebpackConfig({ - loader: ("null", { - test: /webfontloader/, - loader: "null-loader", - }), + module: { + rules: [ + { + test: /webfontloader/, + use: loaders.null(), + }, + ], + }, }) } -}; +} exports.createPages = ({ actions, graphql }) => { const { createPage } = actions;