33 lines
725 B
TypeScript
33 lines
725 B
TypeScript
import { defineConfig } from "vite";
|
|
import vue from "@vitejs/plugin-vue";
|
|
import { fileURLToPath, URL } from "url";
|
|
import AutoImport from "unplugin-auto-import/vite";
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
// ...其他配置
|
|
define: {
|
|
'process.env': process.env
|
|
},
|
|
plugins: [
|
|
vue(),
|
|
AutoImport({
|
|
imports: ["vue", "vue-router"],
|
|
defaultExportByFilename: true,
|
|
dirs: ["./src/api"],
|
|
}),
|
|
],
|
|
css: {
|
|
preprocessorOptions: {
|
|
scss: {
|
|
additionalData: `@use "@/assets/styles/variable.scss" as *;` // 使用 @use 代替 @import
|
|
}
|
|
}
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": fileURLToPath(new URL("./src", import.meta.url)),
|
|
},
|
|
},
|
|
});
|