Skip to content

Commit

Permalink
fix: update launch.json to skip internal/node_modules (#262)
Browse files Browse the repository at this point in the history
  • Loading branch information
shazron authored Aug 15, 2024
1 parent 34ed1e9 commit 228694c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
20 changes: 16 additions & 4 deletions generators/add-vscode-config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,20 @@ class AddVsCodeConfig extends Generator {

initializing () {
this.vsCodeConfig = {
version: '0.2.0',
version: '0.3.0',
configurations: []
}

this.vsCodeConfig.configurations.push({
name: 'App Builder: debug actions',
type: 'node-terminal',
request: 'launch',
command: 'aio app dev'
command: 'aio app dev',
skipFiles: [
'<node_internals>/**/*.js',
// eslint-disable-next-line no-template-curly-in-string
'${workspaceFolder}/node_modules/**/*.js'
]
})

this.vsCodeConfig.configurations.push({
Expand All @@ -61,13 +66,20 @@ class AddVsCodeConfig extends Generator {
request: 'launch',
command: 'aio app dev',
sourceMapPathOverrides: {
'/__parcel_source_root/*': '${webRoot}/*' // eslint-disable-line no-template-curly-in-string
// eslint-disable-next-line no-template-curly-in-string
'/__parcel_source_root/*': '${webRoot}/*'
},
skipFiles: [
'<node_internals>/**/*.js',
// eslint-disable-next-line no-template-curly-in-string
'${workspaceFolder}/node_modules/**/*.js'
],
serverReadyAction: {
pattern: 'server running on port : ([0-9]+)',
uriFormat: 'https://localhost:%s',
action: 'debugWithChrome',
webRoot: '${workspaceFolder}' // eslint-disable-line no-template-curly-in-string
// eslint-disable-next-line no-template-curly-in-string
webRoot: '${workspaceFolder}'
}
})
}
Expand Down
15 changes: 11 additions & 4 deletions test/__fixtures__/add-vscode-config/launch.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
{
"version": "0.2.0",
"version": "0.3.0",
"configurations": [
{
"name": "App Builder: debug actions",
"type": "node-terminal",
"request": "launch",
"command": "aio app dev"
},
{
"command": "aio app dev",
"skipFiles": [
"<node_internals>/**/*.js",
"${workspaceFolder}/node_modules/**/*.js"
]
}, {
"name": "App Builder: debug full stack",
"type": "node-terminal",
"request": "launch",
"command": "aio app dev",
"sourceMapPathOverrides": {
"/__parcel_source_root/*": "${webRoot}/*"
},
"skipFiles": [
"<node_internals>/**/*.js",
"${workspaceFolder}/node_modules/**/*.js"
],
"serverReadyAction": {
"pattern": "server running on port : ([0-9]+)",
"uriFormat": "https://localhost:%s",
Expand Down

0 comments on commit 228694c

Please sign in to comment.