Skip to content

Commit

Permalink
feat: add support VSCode launch.json (fixes #182)
Browse files Browse the repository at this point in the history
  • Loading branch information
jooy2 committed Dec 24, 2024
1 parent 4efdf33 commit df829d1
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 3 deletions.
32 changes: 32 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/main/utils/Constants.ts
Original file line number Diff line number Diff line change
@@ -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))
Expand All @@ -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')
}

0 comments on commit df829d1

Please sign in to comment.