vscode debug ES6 application

后端 未结 9 729
小鲜肉
小鲜肉 2020-12-24 02:44

I have VSCode 0.5.0. I set the compilerOptions flag to \"ES6\" and the editor started recognizing my ES6 code as correct. I have babel installed. My Mocha tests use the bab

9条回答
  •  借酒劲吻你
    2020-12-24 02:53

    Assuming you have babel-cli installed as a local module in your project the following should work.

    launch.json

    {
        "version": "0.2.0",
        "configurations": [
            {
                "name": "Launch",
                "type": "node",
                "request": "launch",
                "program": "${workspaceRoot}/node_modules/babel-cli/bin/babel-node.js",
                "stopOnEntry": false,
                "args": [
                    "${workspaceRoot}/server.js"
                ],
    ...
    

提交回复
热议问题