From 3729b1bc7c9d49c31aead96b1d705763010ea5a8 Mon Sep 17 00:00:00 2001 From: liujiayii Date: Fri, 24 Jan 2025 09:12:52 +0800 Subject: [PATCH] feat: better vite.config.ts --- vite.config.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index f0fec23..aa084ce 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -19,7 +19,7 @@ import ViteRestart from 'vite-plugin-restart' import { copyNativeRes } from './vite-plugins/copyNativeRes' // https://vitejs.dev/config/ -export default ({ command, mode }) => { +export default defineConfig(({ command, mode }) => { // console.log(mode === process.env.NODE_ENV) // true // mode: 区分生产环境还是开发环境 @@ -46,7 +46,7 @@ export default ({ command, mode }) => { } = env console.log('环境变量 env -> ', env) - return defineConfig({ + return { envDir: './env', // 自定义env目录 plugins: [ @@ -156,5 +156,5 @@ export default ({ command, mode }) => { }, }, }, - }) -} + } +})