storybook/docs/_snippets/storybook-addons-preset-webpackFinal.md
2024-06-13 17:53:08 +01:00

796 B

export function webpackFinal(config, options = {}) {
  const rules = [
    ...(config.module?.rules || []),
    {
      test: /\.custom-file-extension$/,
      loader: require.resolve(`custom-loader`),
    },
  ];
  config.module.rules = rules;

  return config;
}
import type { Configuration as WebpackConfig } from 'webpack';

export function webpackFinal(config: WebpackConfig, options: any = {}) {
  const rules = [
    ...(config.module?.rules || []),
    {
      test: /\.custom-file$/,
      loader: require.resolve(`custom-loader`),
    },
  ];
  config.module.rules = rules;

  return config;
}