diff --git a/.gitignore b/.gitignore index 29db87f..e80742c 100644 --- a/.gitignore +++ b/.gitignore @@ -110,3 +110,6 @@ docs/*.aux # Mac's Finder's DS_Store files **/.DS_Store + +# Firefox debug storage +tmp diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..9f9f828 --- /dev/null +++ b/.vscode/launch.json @@ -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" + } + ] + } + ] +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..6cc7c13 --- /dev/null +++ b/.vscode/tasks.json @@ -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": ".", + } + } + ] + } + ] +} diff --git a/package.json b/package.json index bbf7292..1e88410 100644 --- a/package.json +++ b/package.json @@ -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"