Last active
April 30, 2023 17:49
-
-
Save Jack-Works/80d69633a55af03cec1f1d6328ffa9d1 to your computer and use it in GitHub Desktop.
Debug TypeScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "launch", | |
"name": "Mocha Tests (currently opened test)", | |
"runtimeArgs": ["--nolazy"], | |
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", | |
"args": [ | |
"-u", | |
"bdd", | |
"--no-timeouts", | |
"--colors", | |
"built/local/run.js", | |
"-f", | |
// You can change this to be the name of a specific test file (without the file extension) | |
// to consistently launch the same test | |
"${fileBasenameNoExtension}", | |
"--skip-percent", | |
"0" | |
], | |
"env": { | |
"NODE_ENV": "testing" | |
}, | |
"outFiles": [ | |
"${workspaceFolder}/built/**/*.js", | |
"${workspaceFolder}/built/**/*.mjs", | |
"${workspaceFolder}/built/**/*.cjs", | |
"!**/node_modules/**" | |
], | |
"preLaunchTask": "npm: build:tests", | |
"console": "integratedTerminal", | |
"customDescriptionGenerator": "'__tsDebuggerDisplay' in this ? this.__tsDebuggerDisplay(defaultValue) : defaultValue" | |
}, | |
{ | |
// See: https://github.com/microsoft/TypeScript/wiki/Debugging-Language-Service-in-VS-Code | |
"type": "node", | |
"request": "attach", | |
"name": "Attach to VS Code TS Server via Port", | |
"processId": "${command:PickProcess}", | |
"customDescriptionGenerator": "'__tsDebuggerDisplay' in this ? this.__tsDebuggerDisplay(defaultValue) : defaultValue", | |
"outFiles": ["${workspaceFolder}/built/local/*.js", "!**/node_modules/**"], | |
"port": 5667 | |
}, | |
{ | |
"type": "node", | |
"name": "Launch VSCode", | |
"request": "launch", | |
"runtimeExecutable": "${execPath}", | |
"args": ["--user-data-dir=${workspaceFolder}/.vscode/.vscode-debug", "${workspaceFolder}/../vscode-debug"], | |
"env": { | |
"TSS_DEBUG": "5667", | |
"NODE_ENV": "development" | |
} | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// Use the TypeScript debug build. Change to your repo if it is not the case. | |
"typescript.tsdk": "../TypeScript/built/local", | |
// The following two options are intended to disable the extra process started so we can attach to the target faster (only 1 result after filter with "local") | |
"typescript.tsserver.useSyntaxServer": "never", | |
"typescript.disableAutomaticTypeAcquisition": true, | |
"window.zoomLevel": 1, | |
"editor.suggestSelection": "first", | |
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue", | |
"workbench.colorTheme": "Quiet Light" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts": { | |
"start": "node ../TypeScript/built/local/tsc.js -w -p .", | |
"build": "node ../TypeScript/built/local/tsc.js -p ." | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment