const path = require('path');

module.exports = async ({ config, mode }) => {
  // `mode` has a value of 'DEVELOPMENT' or 'PRODUCTION'
  // You can change the configuration based on that.
  // 'PRODUCTION' is used when building the static version of storybook.

  config.resolve.alias = {
    ...config.resolve.alias,
    Components: path.resolve(__dirname, '../src/components/'),
    Fonts: path.resolve(__dirname, '../src/fonts/'),
    Themes: path.resolve(__dirname, '../src/themes/'),
    Storybook: path.resolve(__dirname, './'),
  };

  config.module.rules = [
    ...config.module.rules,
    {
      test: /\.svg$/,
      use: ['@svgr/webpack'],
    }
  ];
  
  return config;
};
