Reactjs 从VisualStudio代码而不是从Chrome调试SPFx断点和调试
我试图找到一种方法,从Visual Studio代码而不是从Chrome调试我的本地SPFx工作台,但我找不到任何关于如何将Chrome附加到Visual Studio代码并在react typescript web部件(web应用程序)中点击断点的指南。关于如何做,有什么好的指南吗 这可能是一件小事,但我对react-gulp vs-code的世界还不熟悉,在过去,使用Visual Studio和IExplorer调试javascript相对容易,我想知道Visual Studio代码是否也存在简单的设置Reactjs 从VisualStudio代码而不是从Chrome调试SPFx断点和调试,reactjs,typescript,sharepoint,office365,visual-studio-code,Reactjs,Typescript,Sharepoint,Office365,Visual Studio Code,我试图找到一种方法,从Visual Studio代码而不是从Chrome调试我的本地SPFx工作台,但我找不到任何关于如何将Chrome附加到Visual Studio代码并在react typescript web部件(web应用程序)中点击断点的指南。关于如何做,有什么好的指南吗 这可能是一件小事,但我对react-gulp vs-code的世界还不熟悉,在过去,使用Visual Studio和IExplorer调试javascript相对容易,我想知道Visual Studio代码是否也存
谢谢 这个VS代码扩展可能正是您所需要的
此VS代码扩展可能正是您所需要的
这方面的快速更新@gruss对Chrome调试器的看法是正确的,但我想更进一步,创建一个指南 Office开发团队的官方文件如下: 我在这里找到了非常有用的文章: 我还在这里创建了一个: 使用launch.json配置的要点如下: 此处粘贴的配置用于快速参考:
// Use Chrome browser to debug SharePoint Framework React webpart with Visual Studio Code on Windows
// - Install "Debugger for Chrome" extension
// - Add this configuration to the launch.json
// - Close all Chrome browser active instances
// - Start the SPFx nodejs server by executing "gulp serve"
// - Go to VS Code debug view (top menu -> View -> Debug)
// - Hit the play (start debugging) button
// Happy debugging!
// Full guides
// http://blog.velingeorgiev.pro/how-debug-sharepoint-framework-webpart-visual-studio-code
// https://dev.office.com/sharepoint/docs/spfx/debug-in-vscode
{
"version": "0.2.0",
"configurations": [
{
"name": "SPFx Local",
"type": "chrome",
"request": "launch",
"url": "https://localhost:4321/temp/workbench.html",
"webRoot": "${workspaceRoot}",
"sourceMaps": true,
"sourceMapPathOverrides": {
"webpack:///../../../src/*": "${webRoot}/src/*",
"webpack:///../../../../src/*": "${webRoot}/src/*",
"webpack:///../../../../../src/*": "${webRoot}/src/*"
},
"runtimeArgs": [
"--remote-debugging-port=9222"
]
},
{
"name": "SPFx Online",
"type": "chrome",
"request": "launch",
"url": "https://<your_tenant>.sharepoint.com/sites/<your_site>/SitePages/<your_webpart_page>.aspx",
"webRoot": "${workspaceRoot}",
"sourceMaps": true,
"sourceMapPathOverrides": {
"webpack:///../../../src/*": "${webRoot}/src/*",
"webpack:///../../../../src/*": "${webRoot}/src/*",
"webpack:///../../../../../src/*": "${webRoot}/src/*"
},
"runtimeArgs": [
"--remote-debugging-port=9222"
]
},
{
"name": "SPFx Online Workbench",
"type": "chrome",
"request": "launch",
"url": "https://<your_tenant>.sharepoint.com/_layouts/workbench.aspx",
"webRoot": "${workspaceRoot}",
"sourceMaps": true,
"sourceMapPathOverrides": {
"webpack:///../../../src/*": "${webRoot}/src/*",
"webpack:///../../../../src/*": "${webRoot}/src/*",
"webpack:///../../../../../src/*": "${webRoot}/src/*"
},
"runtimeArgs": [
"--remote-debugging-port=9222"
]
}
]
}
//使用Chrome浏览器在Windows上使用Visual Studio代码调试SharePoint Framework React Web部件
//-安装“Chrome调试器”扩展
//-将此配置添加到launch.json
//-关闭所有Chrome浏览器活动实例
//-通过执行“gulp serve”启动SPFx nodejs服务器
//-转到VS代码调试视图(顶部菜单->视图->调试)
//-点击播放(开始调试)按钮
//调试愉快!
//完整指南
// http://blog.velingeorgiev.pro/how-debug-sharepoint-framework-webpart-visual-studio-code
// https://dev.office.com/sharepoint/docs/spfx/debug-in-vscode
{
“版本”:“0.2.0”,
“配置”:[
{
“名称”:“SPFx本地”,
“类型”:“铬”,
“请求”:“启动”,
“url”:”https://localhost:4321/temp/workbench.html",
“webRoot”:“${workspaceRoot}”,
“源地图”:正确,
“sourceMapPathOverrides”:{
"webpack:///../../../src/*“:“${webRoot}/src/*”,
"webpack:///../../../../src/*“:“${webRoot}/src/*”,
"webpack:///../../../../../src/*“:“${webRoot}/src/*”
},
“runtimeArgs”:[
“--远程调试端口=9222”
]
},
{
“名称”:“SPFx在线”,
“类型”:“铬”,
“请求”:“启动”,
“url”:”https://.sharepoint.com/sites//SitePages/.aspx",
“webRoot”:“${workspaceRoot}”,
“源地图”:正确,
“sourceMapPathOverrides”:{
"webpack:///../../../src/*“:“${webRoot}/src/*”,
"webpack:///../../../../src/*“:“${webRoot}/src/*”,
"webpack:///../../../../../src/*“:“${webRoot}/src/*”
},
“runtimeArgs”:[
“--远程调试端口=9222”
]
},
{
“名称”:“SPFx在线工作台”,
“类型”:“铬”,
“请求”:“启动”,
“url”:”https://.sharepoint.com/_layouts/workbench.aspx",
“webRoot”:“${workspaceRoot}”,
“源地图”:正确,
“sourceMapPathOverrides”:{
"webpack:///../../../src/*“:“${webRoot}/src/*”,
"webpack:///../../../../src/*“:“${webRoot}/src/*”,
"webpack:///../../../../../src/*“:“${webRoot}/src/*”
},
“runtimeArgs”:[
“--远程调试端口=9222”
]
}
]
}
如果有任何问题,请告诉我。快速更新此信息@gruss对Chrome调试器的看法是正确的,但我想更进一步,创建一个指南 Office开发团队的官方文件如下: 我在这里找到了非常有用的文章: 我还在这里创建了一个: 使用launch.json配置的要点如下: 此处粘贴的配置用于快速参考:
// Use Chrome browser to debug SharePoint Framework React webpart with Visual Studio Code on Windows
// - Install "Debugger for Chrome" extension
// - Add this configuration to the launch.json
// - Close all Chrome browser active instances
// - Start the SPFx nodejs server by executing "gulp serve"
// - Go to VS Code debug view (top menu -> View -> Debug)
// - Hit the play (start debugging) button
// Happy debugging!
// Full guides
// http://blog.velingeorgiev.pro/how-debug-sharepoint-framework-webpart-visual-studio-code
// https://dev.office.com/sharepoint/docs/spfx/debug-in-vscode
{
"version": "0.2.0",
"configurations": [
{
"name": "SPFx Local",
"type": "chrome",
"request": "launch",
"url": "https://localhost:4321/temp/workbench.html",
"webRoot": "${workspaceRoot}",
"sourceMaps": true,
"sourceMapPathOverrides": {
"webpack:///../../../src/*": "${webRoot}/src/*",
"webpack:///../../../../src/*": "${webRoot}/src/*",
"webpack:///../../../../../src/*": "${webRoot}/src/*"
},
"runtimeArgs": [
"--remote-debugging-port=9222"
]
},
{
"name": "SPFx Online",
"type": "chrome",
"request": "launch",
"url": "https://<your_tenant>.sharepoint.com/sites/<your_site>/SitePages/<your_webpart_page>.aspx",
"webRoot": "${workspaceRoot}",
"sourceMaps": true,
"sourceMapPathOverrides": {
"webpack:///../../../src/*": "${webRoot}/src/*",
"webpack:///../../../../src/*": "${webRoot}/src/*",
"webpack:///../../../../../src/*": "${webRoot}/src/*"
},
"runtimeArgs": [
"--remote-debugging-port=9222"
]
},
{
"name": "SPFx Online Workbench",
"type": "chrome",
"request": "launch",
"url": "https://<your_tenant>.sharepoint.com/_layouts/workbench.aspx",
"webRoot": "${workspaceRoot}",
"sourceMaps": true,
"sourceMapPathOverrides": {
"webpack:///../../../src/*": "${webRoot}/src/*",
"webpack:///../../../../src/*": "${webRoot}/src/*",
"webpack:///../../../../../src/*": "${webRoot}/src/*"
},
"runtimeArgs": [
"--remote-debugging-port=9222"
]
}
]
}
//使用Chrome浏览器在Windows上使用Visual Studio代码调试SharePoint Framework React Web部件
//-安装“Chrome调试器”扩展
//-将此配置添加到launch.json
//-关闭所有Chrome浏览器活动实例
//-通过执行“gulp serve”启动SPFx nodejs服务器
//-转到VS代码调试视图(顶部菜单->视图->调试)
//-点击播放(开始调试)按钮
//调试愉快!
//完整指南
// http://blog.velingeorgiev.pro/how-debug-sharepoint-framework-webpart-visual-studio-code
// https://dev.office.com/sharepoint/docs/spfx/debug-in-vscode
{
“版本”:“0.2.0”,
“配置”:[
{
“名称”:“SPFx本地”,
“类型”:“铬”,
“请求”:“启动”,
“url”:”https://localhost:4321/temp/workbench.html",
“webRoot”:“${workspaceRoot}”,
“源地图”:正确,
“sourceMapPathOverrides”:{
"webpack:///../../../src/*“:“${webRoot}/src/*”,
"webpack:///../../../../src/*“:“${webRoot}/src/*”,
"webpack:///../../../../../src/*“:“${webRoot}/src/*”
},
“runtimeArgs”:[
“--远程调试端口=9222”
]
},
{
“名称”:“SPFx在线”,
“类型”:“铬”,
“请求”:“启动”,
“url”:”https://.sharepoint.com/sites//SitePages/.aspx",
“webRoot”:“${workspaceRoot}”,
“源地图”:正确,
“sourceMapPathOverrides”:{
"webpack:///../../../src/*“:“${webRoot}/src/*”,
"webpack:///../../../../src/*“:“${webRoot}/src/*”,
"webpack:///../../../../../src/*“:“${webRoot}/src/*”
},
“runtimeArgs”:[
“--远程调试端口=9222”
]
},
{
“名称”:“SPFx在线工作台”,
“类型”:“铬”,
“requ