text: const path = require("path");
  const toPath = (_path) => path.join(process.cwd(), _path);
  
  module.exports = {
    stories: ['../src/components/**/stories/*.stories.@(ts|tsx)'],
    addons: [
      '@storybook/addon-actions',
      '@storybook/addon-links',
      '@storybook/addon-docs',
    ],
    webpackFinal: async config => {
      config.module.rules.push({
        test: /\.(ts|tsx)$/,
        use: [
          {
            loader: require.resolve('ts-loader'),
            options: {
              transpileOnly: true,
            },
          },
          {
            loader: require.resolve('react-docgen-typescript-loader'),
          },
        ],
      });
  
      config.resolve.extensions.push('.ts', '.tsx');
      config.resolve.alias['@emotion/core'] = toPath("node_modules/@emotion/react");
      config.resolve.alias['emotion-theming'] = toPath("node_modules/@emotion/react")
  
      return config;
    },
  };
  