应用项目规范

除了基础配置文件和特殊声明的文件外,所有代码文件已 .ts 作为后缀名
详细情况请参考 https://github.com/easy-team/ves-admin 骨架项目规范

项目整体结构


默认配置

  • config/ves.config.jseasywebpack 构建配置文件,除 entry 外,一般无需额外配置(注意该文件为 js 文件)

  • config/tsconfig.json 为 前后端 TypeScript 基础配置,后续考虑内置 ves 框架

  • tsconfig.json 为 Node 端 TypeScript 基础配置,集成 config/tsconfig.json , 后续考虑内置 ves 框架

  • app/web/tsconfig.json 为前端 TypeScript 基础配置,集成 config/tsconfig.json 后续考虑内置 ves 框架

约束说明

  • 前端渲染时,vue ssr 默认 layout 为 node_modules/ves/app/web/view/layout.html可以通过如下方式覆盖配置。无特殊要求,无需配置。
//${root}/config/config.default.js
exports.vuessr = {
  layout: path.join(app.baseDir, 'app/web/view/layout.html'),
};
  • 本地开发时,Webpack 编译文件在内存,ves build 时落地磁盘。Node 端运行文件存放到 app/view 目录,前端构建文件存放到 app/public 目录。框架已内置处理,无需关心。
  • TypeScript 构建会在各目录生成 ts 对应的 js 文件,js 文件是被 Git 忽略的,同时需要配置 vscode 隐藏 js 文件
{
 "files.exclude": {
    "**/*.js": {
      "when": "$(basename).ts"
    }
  }
}

Author: sky
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint polocy. If reproduced, please indicate source sky !
 Previous
工程介绍 工程介绍
Egg Vue 工程解决方案特性支持Node 端基于 Egg 开发,遵循 Egg 开发规范和 Egg 生态,支持 Egg 所有特性,比如插件机制,多进程机制。使用 TypeScript 或 JavaScript 编写前端和Node端代码,支持 ts-node 无编译 和 Webpack 编译开...
2019-11-30 sky
Next 
项目配置 项目配置
应用项目规范遵循 Egg 项目开发规范,其中 app/web 目录为前端代码, config/res.config.js 为 webpack 配置文件本地开发 Webpack 内存构建,发布构建静态资源在 app/public 目录,服务端在 app/view 目录TypeScript ...
2019-11-10 sky