SVGR support (React only)

Your code may be relying on SVG files imported as React components, such as:

import { ReactComponent as Logo } from "./logo.svg";

In order to make this work, you will need to add a dev dependency on vite-plugin-react-svgr (or any other SVGR plugin for Vite) and customise preview.config.js:

// preview.config.js
const { svgr } = require("vite-plugin-react-svgr");

/** @type {import("@previewjs/config").PreviewConfig} */
module.exports = {
  vite: {
    plugins: [
      svgr({
        exportAs: "ReactComponent",
        // exportAs: "default" if you want `import Logo from "./logo.svg"` instead

        // If you import SVG files via an alias, you'll need to also pass "alias" here.
        // See https://previewjs.com/docs/config/aliases
        //
        // alias: { ... }
      }),
    ],
  },
};