【问题标题】:Debug Angular-CLI app accross Visual Studio Code not on localhost:4200跨 Visual Studio Code 调试 Angular-CLI 应用程序不在 localhost:4200
【发布时间】:2019-04-08 16:54:38
【问题描述】:

全部!

如何在 Visual Studio Code 中为具有任意 url 的 Angular-CLI 应用程序启用调试模式。 使用默认的 ng serve url (localhost:4200) 它可以正常工作。 使用另一个 url 设置断点但未绑定。

这里是 vscode launch.config

{
        "type": "chrome",
        "request": "launch",
        "name": "Launch Chrome",
        "sourceMaps": true,
        "sourceMapPathOverrides": {
            "webpack:///./*":"${workspaceRoot}/*"
        },
        "url": "http://localhost/CountrySite/v2/",
        "webRoot": "${workspaceRoot}"
    },

app folder structure

谢谢

【问题讨论】:

    标签: google-chrome visual-studio-code angular-cli


    【解决方案1】:

    原因是在从 Web 服务器返回的 js-sourcemaps 的 401 响应中。 解决了

    【讨论】:

    • 在某些情况下,我的网络服务器不允许从 webRoot 文件夹下载 js-sourcemaps。将 webRoot 添加到白名单
    猜你喜欢
    • 2018-12-01
    • 2016-10-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-07
    • 2022-06-15
    • 1970-01-01
    • 2016-12-27
    相关资源
    最近更新 更多