text: /**
   * Known issues:
   * 1) TypeScript Module Resolution
   * https://storybook.js.org/docs/react/configure/webpack#typescript-module-resolution
   *
   * 2) Use with Tailwind
   * https://stackoverflow.com/a/68757745/2403981
   */
  
  const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin')
  
  module.exports = {
    stories: ['../**/*.stories.mdx', '../**/*.stories.@(js|jsx|ts|tsx)'],
    addons: [
      '@storybook/addon-links',
      '@storybook/addon-essentials',
      {
        name: '@storybook/addon-postcss',
        options: {
          cssLoaderOptions: {
            importLoaders: 1
          },
          postcssLoaderOptions: {
            implementation: require('postcss')
          }
        }
      }
    ],
    framework: '@storybook/react',
    webpackFinal: async (config) => {
      config.resolve.plugins = [
        ...(config.resolve.plugins || []),
        new TsconfigPathsPlugin({
          extensions: config.resolve.extensions
        })
      ]
      return config
    }
  }
  