From 228694c0f1975126ab11b93180dbe414136a2b7c Mon Sep 17 00:00:00 2001 From: Shazron Abdullah <36107+shazron@users.noreply.github.com> Date: Thu, 15 Aug 2024 11:12:57 +0800 Subject: [PATCH] fix: update launch.json to skip internal/node_modules (#262) --- generators/add-vscode-config/index.js | 20 +++++++++++++++---- .../add-vscode-config/launch.json | 15 ++++++++++---- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/generators/add-vscode-config/index.js b/generators/add-vscode-config/index.js index 745ea87..c5e4486 100644 --- a/generators/add-vscode-config/index.js +++ b/generators/add-vscode-config/index.js @@ -44,7 +44,7 @@ class AddVsCodeConfig extends Generator { initializing () { this.vsCodeConfig = { - version: '0.2.0', + version: '0.3.0', configurations: [] } @@ -52,7 +52,12 @@ class AddVsCodeConfig extends Generator { name: 'App Builder: debug actions', type: 'node-terminal', request: 'launch', - command: 'aio app dev' + command: 'aio app dev', + skipFiles: [ + '/**/*.js', + // eslint-disable-next-line no-template-curly-in-string + '${workspaceFolder}/node_modules/**/*.js' + ] }) this.vsCodeConfig.configurations.push({ @@ -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: [ + '/**/*.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}' } }) } diff --git a/test/__fixtures__/add-vscode-config/launch.json b/test/__fixtures__/add-vscode-config/launch.json index 717b0ce..0fc98d9 100644 --- a/test/__fixtures__/add-vscode-config/launch.json +++ b/test/__fixtures__/add-vscode-config/launch.json @@ -1,13 +1,16 @@ { - "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": [ + "/**/*.js", + "${workspaceFolder}/node_modules/**/*.js" + ] + }, { "name": "App Builder: debug full stack", "type": "node-terminal", "request": "launch", @@ -15,6 +18,10 @@ "sourceMapPathOverrides": { "/__parcel_source_root/*": "${webRoot}/*" }, + "skipFiles": [ + "/**/*.js", + "${workspaceFolder}/node_modules/**/*.js" + ], "serverReadyAction": { "pattern": "server running on port : ([0-9]+)", "uriFormat": "https://localhost:%s",