main.js 879 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import { dirname, join } from 'path';
  2. const customConfig = require('../../../webpack.config.js');
  3. module.exports = {
  4. addons: [
  5. getAbsolutePath('@storybook/addon-controls'),
  6. '@mihkeleidast/storybook-addon-source',
  7. getAbsolutePath('@storybook/addon-actions'),
  8. getAbsolutePath('@storybook/addon-links'),
  9. ],
  10. stories: ['../storybook/stories/**/*.stories.[tj]sx'],
  11. webpackFinal: config => ({
  12. ...config,
  13. module: {
  14. ...config.module,
  15. rules: customConfig.module.rules,
  16. },
  17. resolve: {
  18. ...config.resolve,
  19. ...customConfig.resolve,
  20. },
  21. }),
  22. typescript: {
  23. reactDocgen: 'none',
  24. },
  25. framework: {
  26. name: getAbsolutePath('@storybook/react-webpack5'),
  27. options: {},
  28. },
  29. docs: {
  30. autodocs: false,
  31. },
  32. };
  33. function getAbsolutePath(value) {
  34. return dirname(require.resolve(join(value, 'package.json')));
  35. }