Egret之Visual Studio Code环境配置

一 : 为VSC安装插件 , 一共为2个

1' 是Chrome插件 , 2' Egret插件
具体步骤
①:
Egret之Visual Studio Code环境配置
②:
Egret之Visual Studio Code环境配置
③:
Egret之Visual Studio Code环境配置

二 : 配置 launch.json / tasks.json

1' 按 F5 选择 Chrome , 可以生成 launch.json
Egret之Visual Studio Code环境配置

2' 配置launch.json
①,加入配置:

        {
            "name": "使用本机 Chrome 调试",
            "type": "chrome",
            "request": "launch",
            // "file": "index.html",
            "url": "http://10.10.20.120:3000/index.html", //使用外部服务器时,请注释掉 file, 改用 url, 并将 useBuildInServer 设置为 false "http://mysite.com/index.html
            "runtimeExecutable": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", // 改成您的 Chrome 安装路径
            "sourceMaps": true,
            "webRoot": "${workspaceRoot}",
            "preLaunchTask":"build",
            "userDataDir":"${tmpdir}",
            "port":5433
        }

如下图:
Egret之Visual Studio Code环境配置

3' 配置tasks.json
原始文件:
Egret之Visual Studio Code环境配置

换成如下文件:

{
    "version": "0.1.0",
    "command": "egret",
    "isShellCommand": true,
    "tasks": [
        {
            "taskName": "build",
            "showOutput": "always",
            "args": [
                "build",
                "-sourcemap"
            ],
            "problemMatcher": "$tsc"
        },
        {
            "taskName": "clean",
            "showOutput": "always",
            "args": [
                "build",
                "-e"
            ],
            "problemMatcher": "$tsc"
        },
        {
            "taskName": "publish",
            "showOutput": "always",
            "args": [
                "publish"
            ],
            "problemMatcher": "$tsc"
        }
    ]
}

结果如下:
Egret之Visual Studio Code环境配置

三 : ctrl +shift + p -> egret StartServer

开始启动游戏吧.........

====================================================================
将ctrl + p , 当前页签不关闭的设置
Egret之Visual Studio Code环境配置

转载于:https://blog.51cto.com/aonaufly/2093999

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值