text: const path = require('path');
  
  module.exports = {
    stories: ['../stories/*.stories.tsx'],
    addons: [
      '@storybook/preset-create-react-app',
      '@storybook/addon-actions',
      '@storybook/addon-links',
      '@storybook/addon-knobs/register',
      '@storybook/addon-a11y/register',
      '@storybook/addon-storysource',
      '@storybook/addon-viewport',
    ],
    webpackFinal: async (config) => {
      config.module.rules.push({
        test: /\.(ts|tsx)$/,
        use: [
          {
            loader: require.resolve('ts-loader'),
            options: {
              configFile: path.join(__dirname, 'tsconfig.json'),
              transpileOnly: true,
            },
          },
          // Optional
          {
            loader: require.resolve('react-docgen-typescript-loader'),
          },
        ],
      });
      config.resolve.extensions.push('.ts', '.tsx');
      return config;
    },
  };
  