mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-01-24 14:33:08 +08:00
* chore: 更新 vite 版本 && 使用 code-inspector-plugin 方便从前端定位到代码位置 * fix: update tailwind config path and conditionally load code-inspector-plugin - Update components.json to reference tailwind.config.cjs instead of deleted tailwind.config.js - Load codeInspectorPlugin only in dev mode to avoid unnecessary code in production builds --------- Co-authored-by: Jason <farion1231@gmail.com>
32 lines
646 B
TypeScript
32 lines
646 B
TypeScript
import path from "node:path";
|
|
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import { codeInspectorPlugin } from "code-inspector-plugin";
|
|
|
|
export default defineConfig(({ command }) => ({
|
|
root: "src",
|
|
plugins: [
|
|
command === "serve" &&
|
|
codeInspectorPlugin({
|
|
bundler: "vite",
|
|
}),
|
|
react(),
|
|
].filter(Boolean),
|
|
base: "./",
|
|
build: {
|
|
outDir: "../dist",
|
|
emptyOutDir: true,
|
|
},
|
|
server: {
|
|
port: 3000,
|
|
strictPort: true,
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
clearScreen: false,
|
|
envPrefix: ["VITE_", "TAURI_"],
|
|
}));
|