Skip to content

Commit

Permalink
fix: Storybook didn't handle useStaticQuery, InstallTabs was not rend…
Browse files Browse the repository at this point in the history
…ering

taken from: gatsbyjs/gatsby#26099 (comment)
  • Loading branch information
g-traub committed Jan 6, 2022
1 parent 9f622d1 commit 89bf295
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .storybook/main.js
Expand Up @@ -22,7 +22,13 @@ module.exports = {
require.resolve('@babel/plugin-proposal-private-methods'),
require.resolve('@babel/plugin-proposal-private-property-in-object'),
// use babel-plugin-remove-graphql-queries to remove static queries from components when rendering in storybook
require.resolve('babel-plugin-remove-graphql-queries'),
[
require.resolve('babel-plugin-remove-graphql-queries'),
{
stage: config.mode === `development` ? 'develop-html' : 'build-html',
staticQueryDir: 'page-data/sq/d',
},
],
];
// Prefer Gatsby ES6 entrypoint (module) over commonjs (main) entrypoint
config.resolve.mainFields = ['browser', 'module', 'main'];
Expand All @@ -40,7 +46,14 @@ module.exports = {
'@babel/plugin-proposal-private-property-in-object'
),
// use babel-plugin-remove-graphql-queries to remove static queries from components when rendering in storybook
require.resolve('babel-plugin-remove-graphql-queries'),
[
require.resolve('babel-plugin-remove-graphql-queries'),
{
stage:
config.mode === `development` ? 'develop-html' : 'build-html',
staticQueryDir: 'page-data/sq/d',
},
],
],
},
},
Expand Down

0 comments on commit 89bf295

Please sign in to comment.