2025-06-29 17:22:25 +08:00
|
|
|
import { defineConfig } from "vite";
|
|
|
|
import vue from "@vitejs/plugin-vue";
|
|
|
|
import { fileURLToPath, URL } from "url";
|
|
|
|
import AutoImport from "unplugin-auto-import/vite";
|
2025-06-29 16:35:22 +08:00
|
|
|
|
|
|
|
// https://vite.dev/config/
|
|
|
|
export default defineConfig({
|
2025-07-04 11:33:47 +08:00
|
|
|
// ...其他配置
|
|
|
|
define: {
|
|
|
|
'process.env': process.env
|
|
|
|
},
|
2025-06-29 17:22:25 +08:00
|
|
|
plugins: [
|
|
|
|
vue(),
|
|
|
|
AutoImport({
|
|
|
|
imports: ["vue", "vue-router"],
|
|
|
|
defaultExportByFilename: true,
|
|
|
|
dirs: ["./src/api"],
|
2025-06-30 22:28:37 +08:00
|
|
|
}),
|
2025-06-29 17:22:25 +08:00
|
|
|
],
|
2025-07-01 15:59:19 +08:00
|
|
|
css: {
|
|
|
|
preprocessorOptions: {
|
|
|
|
scss: {
|
|
|
|
additionalData: `@use "@/assets/styles/variable.scss" as *;` // 使用 @use 代替 @import
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2025-06-29 17:22:25 +08:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
"@": fileURLToPath(new URL("./src", import.meta.url)),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|