How to custom React vite plugin

Hi ! I want to test react-strict-dom with TanStack start but I don't really know how to custom the react vite plugin to use StyleX + RSD babel plugin/preset.

Thanks!

import { defineConfig } from "@tanstack/react-start/config";
import tsConfigPaths from "vite-tsconfig-paths";
import react from "@vitejs/plugin-react";

export default defineConfig({
  vite: {
    plugins: [
      react({
        babel: {
          // plugins: [
          //   [
          //     "@stylexjs/babel-plugin",
          //     {
          //       dev: process.env.NODE_ENV === "development",
          //       test: process.env.NODE_ENV === "test",
          //       runtimeInjection: false,
          //       genConditionalClasses: true,
          //       treeshakeCompensation: true,
          //       unstable_moduleResolution: { type: "commonJS" },
          //     },
          //   ],
          // ],
          // presets: [
          //   // "babel-preset-expo",
          //   [
          //     "react-strict-dom/babel-preset",
          //     {
          //       debug: process.env.NODE_ENV === "development",
          //       dev: process.env.NODE_ENV === "development",
          //       platform: process.env.PLATFORM || "web",
          //     },
          //   ],
          // ],
        },
      }),
      tsConfigPaths({
        projects: ["./tsconfig.json"],
      }),
    ],
  },
});
Was this page helpful?