如何使用MAP文件系统文件夹来调试铬开发人员工具中的原始资源
我有一个网站在https://somewebsite.com/
上运行。
- 它引用了一个编译的JavaScript文件:
/js/site.js
- 映射文件也可以在服务器
/js/site.jsite.map
- Typescript文件上提供 - < strong>我获得的404 for
/js/site.ts
是正确的!
我在c:/project/myapp/wwwroot/js/site.ts.ts
如何将源文件映射到Edge的/Chrome Developer工具上,以便我可以可以,我可以调试它吗?
当我添加c:/projects/myapp/wwwroot/
本地文件夹到工作空间时,文件未链接。
但是,当同一网站在Localhost上运行时,我将本地文件夹添加到工作区时,它可以正常运行!
I have a website running at https://somewebsite.com/
.
- It references a compiled javascript file:
/js/site.js
- mapping file is also available on the server
/js/site.js.map
- typescript file is not available - I'm getting 404 for
/js/site.ts
which is correct!
I have the original typescript file available locally at C:/projects/myapp/wwwroot/js/site.ts
How do I map my source file in Edge's/Chrome developer tools so that I can debug it?
When I add C:/projects/myapp/wwwroot/
local folder to workspace, the files are not linked.
However, when the same website is running on localhost, and I add the local folder to workspace, it works!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,您只能将工作区与Localhost站点一起使用。有关详细信息,您可以参考此线程。
因此,映射文件系统文件夹调试站点的唯一方法是首先在Localhost托管该站点。关于使用工作空间的详细步骤,您可以参考此文档。
Yes, you can only use Workspace with localhost sites. For detailed information, you can refer to this thread.
So the only way to map filesystem folder to debug the site is hosting the site in localhost first. About detailed steps of working with Workspaces, you can refer to this doc.
正如@youzhou回答的那样,我无法映射本地文件夹,但是我可以使用替代:
右键单击Typescript文件,然后选择“为Overrides”保存
然后将本地文件的内容粘贴到Overriden文件
As @YouZhou answered, I cannot map a local folder, but I can use overrides:
Right click the typescript file and choose Save for overrides
Then paste the content of local file to the overriden file