Update readme and fix source maps for debugging (#950)

This commit is contained in:
Martin Aeschlimann
2024-02-02 12:14:21 +01:00
committed by GitHub
parent 6482d03a06
commit ad4db87f53
3 changed files with 16 additions and 30 deletions

View File

@ -3,40 +3,19 @@
"version": "0.2.0",
"configurations": [
{
"name": "Launch Client",
"name": "Run Web Extension ",
"type": "extensionHost",
"debugWebWorkerHost": true,
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionDevelopmentKind=web"
],
"outFiles": [
"${workspaceRoot}/client/dist/**/*.js"
"${workspaceFolder}/client/dist/**/*.js",
"${workspaceFolder}/server/dist/**/*.js"
],
"preLaunchTask": {
"type": "npm",
"script": "watch"
}
},
{
"type": "node",
"request": "attach",
"name": "Attach to Server",
"port": 6009,
"restart": true,
"outFiles": [
"${workspaceRoot}/server/dist/**/*.js"
]
}
],
"compounds": [
{
"name": "Client + Server",
"configurations": [
"Launch Client",
"Attach to Server"
]
"preLaunchTask": "npm: watch"
}
]
}

View File

@ -32,9 +32,14 @@ It also includes an End-to-End test.
- Open VS Code on this folder.
- Press Ctrl+Shift+B to compile the client and server.
- Switch to the Debug viewlet.
- Select `Launch Client` from the drop down.
- Select `Run Web Extension` from the drop down.
- Run the launch config.
- If you want to debug the server as well use the launch configuration `Attach to Server`
- In the [Extension Development Host] instance of VSCode, open a document in 'plain text' language mode.
- Type #00ff00 or any other color in hex format
- color decorators will appear
- You can set breakpoints in the client code. Debugging the server code currently is not working, see issue [#204114](https://github.com/microsoft/vscode/issues/204114).
You can also run and debug the extension in a browser
- `npm run chrome`
- use browser dev tools to set breakpoints

View File

@ -25,6 +25,7 @@ const browserClientConfig = {
filename: '[name].js',
path: path.join(__dirname, 'client', 'dist'),
libraryTarget: 'commonjs',
devtoolModuleFilenameTemplate: '../[resource-path]'
},
resolve: {
mainFields: ['module', 'main'],
@ -53,7 +54,7 @@ const browserClientConfig = {
performance: {
hints: false,
},
devtool: 'source-map',
devtool: 'nosources-source-map',
};
/** @type WebpackConfig */
@ -69,6 +70,7 @@ const browserServerConfig = {
path: path.join(__dirname, 'server', 'dist'),
libraryTarget: 'var',
library: 'serverExportVar',
devtoolModuleFilenameTemplate: '../[resource-path]'
},
resolve: {
mainFields: ['module', 'main'],
@ -97,7 +99,7 @@ const browserServerConfig = {
performance: {
hints: false,
},
devtool: 'source-map',
devtool: 'nosources-source-map',
};
module.exports = [browserClientConfig, browserServerConfig];