Closed jbtheard closed 2 years ago
Add this to .storybook/main.js. Here we transpile gatsby-theme-i18n as well.
webpackFinal: async config => {
// Transpile Gatsby module because Gatsby includes un-transpiled ES6 code.
config.module.rules[0].exclude = [/node_modules\/(?!(gatsby|gatsby-theme-i18n)\/)/];
config.resolve.alias['@reach/router'] = require.resolve(`@gatsbyjs/reach-router`);
return config;
}
Thanks @MaksimAmelchenko it does fix this indeed.
Gatsby Link does provide a specific config for to work in the context of Storybook.
But when switching to from gatsby-theme-i18n , Storybook build fails with the following error:
See reproductible repo here with minimum setup and latest packages versions.