From af6296c780a6da34f3771c706841b71553e114fb Mon Sep 17 00:00:00 2001 From: Kyle Gach Date: Mon, 12 Dec 2022 11:03:58 -0700 Subject: [PATCH] Attempt to correctly configure Webpack --- .storybook/main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.storybook/main.js b/.storybook/main.js index 989239e0..bc6c13cb 100644 --- a/.storybook/main.js +++ b/.storybook/main.js @@ -6,10 +6,12 @@ module.exports = { addons: ['@storybook/addon-essentials'], core: {}, webpack: async (config) => { - config.module.rules[0].exclude = [/node_modules\/(?!(gatsby)\/)/]; + config.module.rules[2].exclude = [/node_modules\/(?!(gatsby)\/)/]; + + console.log('config.module.rules', JSON.stringify(config.module.rules, null, 2)); // use babel-plugin-remove-graphql-queries to remove static queries from components when rendering in storybook - config.module.rules[0].use[0].options.plugins.push([ + config.module.rules[2].use[0].options.plugins.push([ require.resolve('babel-plugin-remove-graphql-queries'), { stage: config.mode === `development` ? 'develop-html' : 'build-html',