main.js 993 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*eslint-env node*/
  2. /*eslint import/no-nodejs-modules:0 */
  3. const path = require('path');
  4. const toPath = p => path.join(process.cwd(), p);
  5. module.exports = {
  6. stories: ['../docs-ui/components/*.stories.*'],
  7. core: {
  8. builder: 'webpack5',
  9. },
  10. addons: [
  11. {
  12. name: '@storybook/addon-essentials',
  13. options: {},
  14. },
  15. '@storybook/addon-a11y',
  16. ],
  17. // XXX(emotion11): Workaround because storybook still uses emotion 10
  18. // internally. See https://github.com/storybookjs/storybook/issues/13145
  19. webpackFinal: async config => {
  20. return {
  21. ...config,
  22. resolve: {
  23. ...config.resolve,
  24. alias: {
  25. ...config.resolve.alias,
  26. '@emotion/core': toPath('node_modules/@emotion/react'),
  27. '@emotion/styled': toPath('node_modules/@emotion/styled'),
  28. 'emotion-theming': toPath('node_modules/@emotion/react'),
  29. '@babel/preset-react': toPath('node_modules/@babel/preset-react'),
  30. },
  31. },
  32. };
  33. },
  34. };