feat: 初始化前端项目基础架构
- 添加路由配置和基础页面组件 - 配置环境变量和全局类型定义 - 实现Pinia状态管理和axios封装 - 添加基础布局组件和全局头部 - 配置Vite构建工具和开发环境
This commit is contained in:
@@ -1,12 +1,26 @@
|
||||
import { defineConfig } from "vite";
|
||||
import { defineConfig, loadEnv } from "vite";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
import path from "path";
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [vue()],
|
||||
server: {
|
||||
host: "0.0.0.0",
|
||||
port: 3000,
|
||||
open: true,
|
||||
},
|
||||
export default defineConfig(({ command, mode }) => {
|
||||
const env = loadEnv(mode, process.cwd(), "");
|
||||
console.log("当前环境:", env.VITE_APP_ENV);
|
||||
return {
|
||||
define: {
|
||||
__APP_ENV__: JSON.stringify(env.VITE_APP_ENV),
|
||||
__API_BASE_URL__: JSON.stringify(env.VITE_API_URL),
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
"@": path.resolve(__dirname, "src"),
|
||||
},
|
||||
},
|
||||
plugins: [vue()],
|
||||
server: {
|
||||
host: "0.0.0.0",
|
||||
port: 3000,
|
||||
open: true,
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user