From df829d199c4e941104a55088e1a9bd309b2fd8b0 Mon Sep 17 00:00:00 2001 From: leejooy96 Date: Tue, 24 Dec 2024 09:50:02 +0900 Subject: [PATCH] feat: add support VSCode `launch.json` (fixes #182) --- .vscode/launch.json | 32 ++++++++++++++++++++++++++++++++ .vscode/settings.json | 2 +- package.json | 5 +++++ src/main/utils/Constants.ts | 4 ++-- 4 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..a912834 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,32 @@ +{ + "version": "1.0.0", + "compounds": [ + { + "name": "Debug Run", + "configurations": [ + "Debug App" + ], + "presentation": { + "hidden": false, + "group": "", + "order": 1 + }, + "stopAll": true + } + ], + "configurations": [ + { + "name": "Debug App", + "request": "launch", + "type": "node", + "timeout": 60000, + "runtimeArgs": [ + "run-script", + "dev" + ], + "cwd": "${workspaceRoot}", + "runtimeExecutable": "npm", + "console": "integratedTerminal" + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index d2e76cb..0d1c016 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,7 +2,7 @@ "workbench.settings.useSplitJSON": true, "eslint.codeActionsOnSave.rules": null, "editor.codeActionsOnSave": { - "source.fixAll.eslint": true + "source.fixAll.eslint": "explicit" }, "eslint.validate": [ "javascript" diff --git a/package.json b/package.json index 7cdd6f3..4787006 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,11 @@ "bugs": { "url": "https://github.com/jooy2/vutron/issues" }, + "debug": { + "env": { + "VITE_DEV_SERVER_URL": "http://localhost:5173" + } + }, "scripts": { "dev": "vite", "dev:debug": "vite -d", diff --git a/src/main/utils/Constants.ts b/src/main/utils/Constants.ts index d385093..2a541ad 100644 --- a/src/main/utils/Constants.ts +++ b/src/main/utils/Constants.ts @@ -1,5 +1,5 @@ import { join, dirname } from 'path' -import { name, version } from '../../../package.json' +import { name, version, debug } from '../../../package.json' import { fileURLToPath } from 'url' const __dirname = dirname(fileURLToPath(import.meta.url)) @@ -21,6 +21,6 @@ export default class Constants { preload: join(__dirname, '../preload/index.js') } - static APP_INDEX_URL_DEV = 'http://localhost:5173/index.html' + static APP_INDEX_URL_DEV = `${debug.env.VITE_DEV_SERVER_URL}/index.html` static APP_INDEX_URL_PROD = join(__dirname, '../index.html') }