feat: add vscode debug file

This commit is contained in:
oceanlvr 2022-02-13 15:52:05 +08:00
parent f7f3ad1042
commit 656519cd68
4 changed files with 49 additions and 3 deletions

1
.gitignore vendored
View File

@ -7,4 +7,3 @@ dist-ssr
tmp
**/.tmp
release
.vscode

44
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,44 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Main",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
// "program": "${workspaceRoot}/packages/main/index.ts",
// "outFiles": [
// "${workspaceRoot}/dist/main/index.cjs"
// ],
"runtimeArgs": [
"./dist/main/index.cjs",
],
"env": {
"VITE_DEV_SERVER_HOST": "127.0.0.1",
"VITE_DEV_SERVER_PORT": "3344"
},
"windows": {
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd"
},
"sourceMaps": true
},
{
"type": "chrome",
"request": "launch",
"name": "Renderer",
"url": "http://localhost:3344",
"webRoot": "${workspaceFolder}/packages/renderer",
},
],
"compounds": [
{
"name": "All",
"configurations": [
"Renderer",
"Main",
]
}
]
}

View File

@ -6,7 +6,9 @@
"license": "MIT",
"scripts": {
"dev": "node scripts/watch.mjs",
"build": "vue-tsc --project packages/renderer/tsconfig.json --noEmit && node scripts/build.mjs && electron-builder"
"prebuild": "vue-tsc --project packages/renderer/tsconfig.json --noEmit && node scripts/build.mjs",
"build": "npm run prebuild && electron-builder",
"debug": "npm run prebuild && vite ./packages/renderer"
},
"engines": {
"node": ">=14.17.0"

View File

@ -11,7 +11,8 @@ export default defineConfig({
formats: ['cjs'],
fileName: () => '[name].cjs',
},
minify: process.env./* from mode option */NODE_ENV === 'production',
minify: false,
sourcemap: true,
emptyOutDir: true,
rollupOptions: {
external: [