简体   繁体   English

如何在 VSCode 中调试咖啡脚本?

[英]How to debug coffeescript in VSCode?

I don't understand, how I should config launch.json file.我不明白,我应该如何配置 launch.json 文件。 For example for debug nodejs-scripts, I just changing configurations.program path, then pressing F5 and all works fine, but what to do with coffee-scripts?例如,对于调试 nodejs 脚本,我只是更改了configuration.program 路径,然后按 F5 一切正常,但是如何处理咖啡脚本呢?

To be honest, I don't know VSCode.老实说,我不知道 VSCode。

But you could run the coffe-script compiler in watch mode and generate map files, then debug the generated javascript:但是你可以在 watch 模式下运行 coffe-script 编译器并生成地图文件,然后调试生成的 javascript:

coffee -c -m -w coffe_source_folder/

because sourcemap, coffee just like js.因为 sourcemap、coffee 就像 js。 anyway here is my launch.json:无论如何这是我的launch.json:

{
    "version": "0.2.0",
    "configurations": [{
        "type": "node",
        "request": "launch",
        "name": "Launch Program",
        "skipFiles": [
            "<node_internals>/**"
        ],
        "program": "${file}", //important, make sure debug current file
        "outFiles": [
            "${workspaceFolder}/dist/api/api.js" //important, where to find sourcemap js file
        ]
    }]
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM