mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-04-20 16:16:37 +08:00
28 lines
677 B
TypeScript
28 lines
677 B
TypeScript
|
|
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"),
|
|||
|
|
},
|
|||
|
|
},
|
|||
|
|
css: {
|
|||
|
|
// css全局变量使用,@/styles/variable.scss文件
|
|||
|
|
preprocessorOptions: {
|
|||
|
|
scss: {
|
|||
|
|
additionalData: '@use "@/styles/var.scss" as *;',
|
|||
|
|
},
|
|||
|
|
},
|
|||
|
|
},
|
|||
|
|
};
|
|||
|
|
});
|