Skip to content

Commit

Permalink
Add VSCode launch and task files for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
acestronautical authored and momijizukamori committed Feb 4, 2024
1 parent d7d4133 commit 55f6aae
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,6 @@ docs/*.aux

# Mac's Finder's DS_Store files
**/.DS_Store

# Firefox debug storage
tmp
30 changes: 30 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"version": "0.2.0",
"configurations": [
{
"preLaunchTask": "npm: dev",
"postDebugTask": "Terminate All Tasks",
"type": "chrome",
"request": "launch",
"name": "Debug Chrome",
"url": "http://localhost:5173/bookbinder-js/",
"webRoot": "${workspaceFolder}",
},
{
"preLaunchTask": "npm: dev",
"postDebugTask": "Terminate All Tasks",
"type": "firefox",
"request": "launch",
"name": "Debug Firefox",
"url": "http://localhost:5173/bookbinder-js/",
"webRoot": "${workspaceFolder}",
"tmpDir": "${workspaceFolder}/tmp",
"pathMappings": [
{
"url": "http://localhost:5173/bookbinder-js/src",
"path": "${workspaceFolder}/src"
}
]
}
]
}
45 changes: 45 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"version": "2.0.0",
"inputs": [
{
"id": "terminate",
"type": "command",
"command": "workbench.action.tasks.terminate",
"args": "terminateAll"
}
],
"tasks": [
{
"label": "Terminate All Tasks",
"command": "echo ${input:terminate}",
"type": "shell",
"problemMatcher": []
},
{
"type": "npm",
"isBackground": true,
"script": "dev",
"label": "npm: dev",
"detail": "vite --port 5173",
// All this is needed so that VSCode doesn't wait for the prelaunch
// task to complete and just lets it run in the background
"problemMatcher": [
{
"pattern": [
{
"regexp": ".",
"file": 1,
"location": 2,
"message": 3
}
],
"background": {
"activeOnStart": true,
"beginsPattern": ".",
"endsPattern": ".",
}
}
]
}
]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "An app to rearrange PDF pages for printing for bookbinding",
"type": "module",
"scripts": {
"dev": "vite",
"dev": "vite --port 5173",
"build": "vite build",
"preview": "vite preview",
"test": "vitest"
Expand Down

0 comments on commit 55f6aae

Please sign in to comment.