import { defineConfig } from "@rsbuild/core"; import { pluginBabel } from "@rsbuild/plugin-babel"; import { pluginSolid } from "@rsbuild/plugin-solid"; import tailwindcss from "@tailwindcss/postcss"; import { BundleAnalyzerPlugin } from "webpack-bundle-analyzer"; export default defineConfig({ plugins: [ pluginBabel({ include: /\.(?:jsx|tsx)$/, }), pluginSolid(), ], tools: { postcss: { postcssOptions: { plugins: [tailwindcss()], }, }, rspack: { module: { rules: [ { test: /\.md|\.yarn|\.csv$/, exclude: /\.schema\.csv$/, type: "asset/source", }, ], }, plugins: [ process.env.ANALYZE ? new BundleAnalyzerPlugin() : undefined, ].filter(Boolean), }, }, html: { template: "./src/index.html", }, source: { entry: { index: "./src/main.tsx", }, }, output: { distPath: { root: "dist/web", }, copy: process.env.NODE_ENV === "development" ? [{ from: "./content", to: "content" }] : [], }, });