使用 Eggjs Vite Vue3 搭建的示例项目
yarn installyarn run dev
安装依赖
yarn install发布
yarn run deploy启动
yarn run start停止
yarn run stop通过 egg 作为入口服务,经过中间件启动 vite 服务,视图中输出 vite 服务入口模块
root
├─ app # 服务端目录
│ ├─ controller
│ │ └─ home.ts
│ ├─ middleware
│ │ └─ vite.ts
│ ├─ public
│ ├─ service
│ │ └─ Test.ts
│ └─ view
│ └─ index.html
├─ client # 前端目录
│ ├─ components
│ │ ├─ DynamicView.vue
│ │ └─ Hello.vue
│ ├─ App.vue
│ └─ main.ts
├─ config # 相关配置
│ ├─ config.default.ts
│ ├─ config.local.ts
│ ├─ config.prod.ts
│ └─ plugin.ts
├─ README.md
├─ appveyor.yml
├─ package.json
├─ tsconfig.json
└─ yarn.lock
通过修改 config/config.local.ts 中 vite 配置更新前端界面相关功能
项目集成 egg-decorator-router、tailwindcss、json-to-render、element-plus