egret官方已经无法访问,相关资源下载https://egret.pages.dev/,感谢热心网友提供。

1 .先从网络上搜索下载 vscode,后边要用 2.上述页面中下载Egret Engine 并安装,安装后的程序为Egret Launcher

3.运行程序,使用离线模式 4.上述页面下载 egret 引擎包,下载指定版本后解压 ,Egret Launcher中选择本地安装引擎: 安装后检查一下,可以看到这里的路径就是我们上图拖入的路径并没有复制一份单独维护,所以注意如果你是下载后直接解压、拖入程序的不要删了解压后的文件: 5.项目页签,新建一个项目,全部使用默认设置即可,这里只是为了测试 6.创建完成后 提示建议安装 egret Coder, 不需要,选择否即可,然后会自动使用 vscode打开新建的项目 7.先安装nodejs https://nodejs.org/en/download/prebuilt-installer 等待安装完成 8.安装EgretCompiler https://egret-docs.pages.dev/install-and-upgrade 文中提到了三种方法,方法1由于无法从Launcher中下载,所以pass。方法2、方法3均可(注意原始配置的npm淘宝源失效了,需要换成https://registry.npmmirror.com)

方法2: 调整scripts/plugins/webpack-plugin.ts 文件前两行的注释:

//require('./npm').installFromLauncher(['@egret/egret-webpack-bundler']);

require('./npm').installDependencies(["@egret/egret-webpack-bundler"]);

修改scripts/plugins/npm.ts 文件中的源:

文中搜索将 https://registry.npm.taobao.org 改为 https://registry.npmmirror.com

稍后在运行时即会安装

方法3: 进入scripts/plugins/ 文件夹 执行: typescript npm install @egret/egret-webpack-bundler --save --registry https://registry.npmmirror.com 等待安装完成 如果提示 Net Error 之类的可以尝试使用其他源

9.vscode中打开终端窗口,执行 egret build ,应该会输出编译成功,到此为止,egret就可以做正常发布了web版本了,项目发布的相关文档 https://egret-docs.pages.dev/publish1,第三方库使用的相关文档https://egret-docs.pages.dev/instructions,对于其他各个平台的小游戏、离线模式等遇到的问题可以参考网友的方案 https://ronpad.com/pages/8654fa/。

如果还有开发需求则继续往下

10.安装chrome,https://www.google.cn/chrome/?standalone=1&platform=win64 11.重启vscode,然后安装Egret Helper 扩展,选择chrome配置即可调试

旧项目的处理

如果打开旧项目找不到 Egret Complier ,可尝试先删除项目中的scripts/plugins/node_modules/文件夹,重启vscode,再按照步骤8操作。