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;