ruoyi-element-ai/vite.config.ts
2025-06-18 20:29:29 +08:00

30 lines
793 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { defineConfig, loadEnv } from "vite";
import path from "path";
import plugins from "./.build/plugins";
// https://vite.dev/config/
export default defineConfig((cnf) => {
const { mode } = cnf;
const env = loadEnv(mode, process.cwd());
const { VITE_APP_ENV } = env;
return {
base: VITE_APP_ENV === "production" ? "/" : "/",
plugins: plugins(cnf),
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
"~": path.resolve(__dirname, "./src/assets"),
"GCnps": path.resolve(__dirname, "./src/components"),
},
},
css: {
// css全局变量使用@/styles/variable.scss文件
preprocessorOptions: {
scss: {
additionalData: '@use "@/styles/var.scss" as *;',
},
},
},
};
});