This repository has been archived on 2025-10-29. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
FPGA_WebLab/vite.config.ts

60 lines
1.3 KiB
TypeScript
Raw Normal View History

import { fileURLToPath, URL } from "node:url";
2025-03-10 19:48:25 +08:00
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx";
import vueDevTools from "vite-plugin-vue-devtools";
import tailwindcss from "@tailwindcss/postcss";
import autoprefixer from "autoprefixer";
import Components from "unplugin-vue-components/vite";
import RekaResolver from "reka-ui/resolver";
2025-03-10 19:48:25 +08:00
// https://vite.dev/config/
export default defineConfig({
plugins: [
2025-04-26 19:59:35 +08:00
vue({
template: {
compilerOptions: {
// 将所有 wokwi- 开头的标签视为自定义元素
isCustomElement: (tag) => tag.startsWith("wokwi-"),
},
},
2025-04-26 19:59:35 +08:00
}),
2025-03-10 19:48:25 +08:00
vueJsx(),
vueDevTools(),
Components({
dts: true,
resolvers: [
RekaResolver(),
// RekaResolver({
// prefix: '' // use the prefix option to add Prefix to the imported components
// })
],
}),
2025-03-10 19:48:25 +08:00
],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
2025-03-10 19:48:25 +08:00
},
},
css: {
postcss: {
plugins: [tailwindcss(), autoprefixer()],
},
2025-05-12 20:05:26 +08:00
},
build: {
outDir: "wwwroot",
2025-05-12 20:05:26 +08:00
emptyOutDir: true, // also necessary
},
server: {
2025-05-12 21:56:41 +08:00
proxy: {
"/swagger": {
target: "http://localhost:5000",
changeOrigin: true,
},
2025-05-12 21:56:41 +08:00
},
port: 5173,
},
});