最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to make VS code load sourcemaps from an ASP.NET Core app - Stack Overflow

programmeradmin1浏览0评论

I am trying to hit breakpoints in VS code when serving an SPA from an ASP.NET Core app.

The SPA is built with webpack and placed in the ${workspaceFolder}/build folder.

The content is then copied to the ASP.Net Core app's folder structure as laid out below.

The index file with a reference to the app.<hash>.js is in public wwwroot. The app.<hash>.js is in a protected (requires authorization) WebContent folder. I have tried to place app.<hash>.js.map in both wwwroot and WebContent folders.

This is the current state of my launch configuration in VS code launch.json:

 {
        "type": "chrome",
        "name": "Launch Chrome against WebService",
        "sourceMaps": true,
        "request": "launch",
        "url": "http://127.0.0.1:5080",
        "webRoot": "${workspaceFolder}/build/WebContent",
        "resolveSourceMapLocations": [
           "${workspaceFolder}/build/WebContent/**",
           "!http://127.0.0.1:5080/**"
        ],
       "sourceMapPathOverrides": {
       "http://127.0.0.1:5080/WebContent/app.*.js": "${workspaceFolder}/build/WebContent/app.*.js.map",            
    }
 }

I have tried multiple variations of this launch config to make my breakpoints bind, but either the app.<hash>.js or app.<hash>.js.map is loaded into VS code debugging but never both of them.

So how do load both app.<hash>.js and app.<hash>.js.map from a running ASP.NET Core app into a VS Code debugging session so my breakpoints can bind?

On a side note: Chrome loads the sourcemap, and it works, so it's not an issue with the sourcemap.

发布评论

评论列表(0)

  1. 暂无评论