text: const path = require('path');
  const webpack = require('webpack');
  
  module.exports = {
    stories: ['../src/**/*.stories.@(tsx)'],
    addons: [
      {
        name: '@storybook/addon-essentials',
        options: {
          backgrounds: false,
        },
      },
    ],
    typescript: {
      reactDocgen: 'react-docgen-typescript',
      reactDocgenTypescriptOptions: {
        shouldExtractLiteralValuesFromEnum: true,
        propFilter: (prop) =>
          prop.parent ? !/node_modules/.test(prop.parent.fileName) : true,
      },
    },
    webpackFinal: async (config) => {
      config.module.rules.push({
        test: /\.(ts|tsx)$/,
        loader: require.resolve('babel-loader'),
        options: {
          presets: [['react-app', { flow: false, typescript: true }]],
        },
      });
      config.resolve.extensions.push('.ts', '.tsx');
  
      /** Support import svg as React component */
      config.module.rules.unshift({
        test: /\.svg$/,
        use: ['@svgr/webpack?-svgo,+titleProp,+ref![path]', 'url-loader'],
      });
  
      config.plugins.push(
        new webpack.DefinePlugin({
          'process.env.__NEXT_PLUGINS': JSON.stringify(false),
        })
      );
  
      return config;
    },
  };
  