From 258ed150cdbca2ea2ed1420aa94fbcd02b4a45fb Mon Sep 17 00:00:00 2001 From: Felipe Santos Date: Wed, 15 Jun 2022 17:24:05 -0300 Subject: [PATCH] Configure VS Code debug and tasks --- .devcontainer/devcontainer.json | 1 - .vscode/extensions.json | 3 +- .vscode/launch.json | 12 +++---- .vscode/tasks.json | 62 +++++++++++++++++++++++++++------ rollup.config.js | 3 ++ tsconfig.json | 1 + 6 files changed, 61 insertions(+), 21 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a6446e45..cb185df6 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -20,7 +20,6 @@ "esbenp.prettier-vscode", "bierner.lit-html", "runem.lit-plugin", - "auchenberg.vscode-browser-preview", "davidanson.vscode-markdownlint", "redhat.vscode-yaml" ], diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 73865446..01ce9bc7 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -6,8 +6,7 @@ "esbenp.prettier-vscode", "bierner.lit-html", "runem.lit-plugin", - "auchenberg.vscode-browser-preview", "davidanson.vscode-markdownlint", "redhat.vscode-yaml" ] -} \ No newline at end of file +} diff --git a/.vscode/launch.json b/.vscode/launch.json index 076d1551..5fd152d0 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,15 +1,13 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { - "command": "yarn start", - "name": "Run yarn start", + "type": "pwa-chrome", "request": "launch", - "type": "node-terminal", - "internalConsoleOptions": "openOnFirstSessionStart" + "name": "Launch Chrome against Home Assistant", + "url": "http://localhost:8123", + "webRoot": "${workspaceFolder}/dist", + "preLaunchTask": "Rollup & Home Assistant" } ] } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index ee855146..c46d7b55 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,12 +1,52 @@ { - "version": "2.0.0", - "tasks": [ - { - "type": "npm", - "script": "start", - "problemMatcher": [], - "label": "npm: start", - "detail": "rollup -c --watch" - } - ] -} \ No newline at end of file + "version": "2.0.0", + "tasks": [ + { + "label": "Rollup", + "type": "npm", + "script": "start", + "problemMatcher": { + "pattern": [ + { + "regexp": ".", + "file": 1, + "location": 2, + "message": 3 + } + ], + "background": { + "activeOnStart": true, + "beginsPattern": "^bundles", + "endsPattern": "^created" + } + }, + "isBackground": true + }, + { + "label": "Home Assistant", + "type": "shell", + "command": "container start", + "problemMatcher": { + "pattern": [ + { + "regexp": ".", + "file": 1, + "location": 2, + "message": 3 + } + ], + "background": { + "activeOnStart": true, + "beginsPattern": ".", + "endsPattern": "." + } + }, + "isBackground": true + }, + { + "label": "Rollup & Home Assistant", + "dependsOn": ["Rollup", "Home Assistant"], + "problemMatcher": [] + } + ] +} diff --git a/rollup.config.js b/rollup.config.js index bda741e7..19f0e21b 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -69,6 +69,9 @@ const config = { output: { file: 'dist/frigate-hass-card.js', format: 'es', + ...(dev && { + sourcemap: true, + }), }, plugins: plugins, // These two files use this at the toplevel, which causes rollup warning diff --git a/tsconfig.json b/tsconfig.json index 0e8ff671..4bd5772a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,5 +18,6 @@ "resolveJsonModule": true, "experimentalDecorators": true, "esModuleInterop": true, + "sourceMap": true } } \ No newline at end of file