@caryliu/game-lobby
v1.0.1
Published
* 我们使用LayaAir引擎作为底层渲染引擎 * 使用LayaAirIDE作为界面编辑器、版本发布工具 * 使用VSCode作为主要的代码开发与调试工具 * 使用Nodejs的npm作为包管理工具 * 使用Webpack(一个开源库)作为ts文件的编译工具(内部集成ts的编译插件) * ts文件中,使用es6模块管理方法,即文件中类需要export class的方式导出,引用其他类需要先import {cls} from 'xxx'的方式导入
Downloads
18
Readme
开发环境介绍:
- 我们使用LayaAir引擎作为底层渲染引擎
- 使用LayaAirIDE作为界面编辑器、版本发布工具
- 使用VSCode作为主要的代码开发与调试工具
- 使用Nodejs的npm作为包管理工具
- 使用Webpack(一个开源库)作为ts文件的编译工具(内部集成ts的编译插件)
- ts文件中,使用es6模块管理方法,即文件中类需要export class的方式导出,引用其他类需要先import {cls} from 'xxx'的方式导入
开发环境部署:
安装编译环境
- 到 https://nodejs.org 下载安装最新稳定版的node.js(8.9.3)
安装依赖库
- 管理员模式命令行进入trunk目录(或者在vscode按Ctrl+`进入终端)
- 执行:
npm install
- 当看到执行成功后,表示安装成功
编译版本(每次改代码后都要做)
- 方法1:
- 命令行进入trunk目录(或者在vscode按Ctrl+`进入终端)
npm run build
- 方法2:
- 在vscode点击菜单->任务->运行任务->npm:build->永不扫描任务输出
- 这样就会把ts文件编译合并成bin\main.js
- 然后通过index.html引用main.js
调试
- 安装Chrome浏览器,VSCode打开工程
- 先在VSCode里安装Chrome Debugger插件
- 在VSCode里,F5运行,会弹出Chrome浏览器,然后在浏览器里F5刷新一下,即可打断点调试
修改资源
- 在LayaAirIDE的编辑资源模式下,点菜单的导出->导出(或清理并导出)
发布版本
- 先在命令行执行
npm run publish
- 以生成压缩混淆后的bin\main.js
- 在LayaAirIDE点菜单->项目->发布
- 取消勾选 “合并JS文件”
- 取消勾选 “重新编译项目”
- 点构建,直到完成