.storybook/main.js
// Storybook does not currently support emotion 11
// Much of this config is an adaption of the solution here:
// https://github.com/storybookjs/storybook/issues/13277#issuecomment-751747964
const path = require('path');
const toPath = _path => path.join(process.cwd(), _path);
module.exports = {
stories: ['../packages/*/*/*/*.stories.jsx'],
addons: [
'@storybook/addon-knobs',
'@storybook/addon-a11y',
'@storybook/addon-viewport',
'@storybook/addon-docs',
'@storybook/addon-postcss',
],
webpackFinal: async config => {
return {
...config,
resolve: {
...config.resolve,
alias: {
...config.resolve.alias,
'@emotion/core': toPath('node_modules/@emotion/react'),
'@emotion/styled': toPath('node_modules/@emotion/styled'),
'emotion-theming': toPath('node_modules/@emotion/react'),
},
},
};
},
};