import CJS_COMPAT_NODE_URL_br1ewk0hfdg from 'node:url';
import CJS_COMPAT_NODE_PATH_br1ewk0hfdg from 'node:path';
import CJS_COMPAT_NODE_MODULE_br1ewk0hfdg from "node:module";

var __filename = CJS_COMPAT_NODE_URL_br1ewk0hfdg.fileURLToPath(import.meta.url);
var __dirname = CJS_COMPAT_NODE_PATH_br1ewk0hfdg.dirname(__filename);
var require = CJS_COMPAT_NODE_MODULE_br1ewk0hfdg.createRequire(import.meta.url);

// ------------------------------------------------------------
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
// ------------------------------------------------------------

// src/index.ts
import { fileURLToPath } from "node:url";
var webpack = (config) => {
  let rules = [
    ...config.module?.rules || [],
    {
      type: "javascript/auto",
      test: /\.stories\.json$/,
      use: fileURLToPath(import.meta.resolve("@storybook/preset-server-webpack/loader"))
    },
    {
      type: "javascript/auto",
      test: /\.stories\.ya?ml/,
      use: [
        fileURLToPath(import.meta.resolve("@storybook/preset-server-webpack/loader")),
        {
          loader: fileURLToPath(import.meta.resolve("yaml-loader")),
          options: { asJSON: !0 }
        }
      ]
    }
  ];
  return config.module = config.module || {}, config.module.rules = rules, config;
};
export {
  webpack
};
