Skip to content

Commit

Permalink
Attempt to correctly configure Webpack
Browse files Browse the repository at this point in the history
  • Loading branch information
kylegach committed Dec 12, 2022
1 parent 7625b26 commit af6296c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit af6296c

Please sign in to comment.