This project is no longer maintained.
Life got busy — work, kids, and the usual chaos. I no longer have the time or energy to keep up with issues or updates. Use it if it works for you, but don't expect updates or support.

SVGR support

Your code may rely 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

import { defineConfig } from "@previewjs/config";
import { svgr } from "vite-plugin-react-svgr";

export default defineConfig({
  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: { ... }
      }),
    ],
  },
});