From 1f3c8cf45082ac6a56cf39168db015acad9c49b0 Mon Sep 17 00:00:00 2001 From: Adam Tran Date: Sun, 10 Jan 2021 19:58:28 -0500 Subject: [PATCH] Add sourceMaps and vscode debug configurations (#1707) * launch json * vscode updates * clientUrl rename --- .babelrc | 3 ++- .gitignore | 2 +- .vscode/launch.json | 23 +++++++++++++++++++++++ .vscode/settings.json | 5 +++++ build-tools/update | 2 +- 5 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json diff --git a/.babelrc b/.babelrc index 8aa2d4712..62cb094bb 100644 --- a/.babelrc +++ b/.babelrc @@ -31,5 +31,6 @@ ], "compact": true, "comments": false, - "retainLines": true + "retainLines": true, + "sourceMaps": true } diff --git a/.gitignore b/.gitignore index 792d63b52..961f55036 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,6 @@ Thumbs.db npm-debug.log package-lock.json /vendor/ -.vscode /js/battle.js /js/battledata.js @@ -43,6 +42,7 @@ package-lock.json /js/panel-teamdropdown.js /js/panel-battle.js /js/replay-embed.js +/js/*.js.map /replays/caches/ /replays/replay-config.inc.php diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..7b5e31a5d --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,23 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Chrome: Test Client Beta (Preact)", + "port": 9222, + "request": "launch", + "url": "${config:showdown.clientUrl}/testclient-beta.html${config:showdown.server}", + "type": "pwa-chrome", + "webRoot": "${workspaceFolder}", + "preLaunchTask": "npm: build" + }, + { + "name": "Chrome: Test Client", + "port": 9222, + "request": "launch", + "url": "${config:showdown.clientUrl}/testclient.html${config:showdown.server}", + "type": "pwa-chrome", + "webRoot": "${workspaceFolder}", + "preLaunchTask": "npm: build" + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..164db15dc --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "editor.formatOnSave": false, + "showdown.server": "", // e.g., "?~~localhost:8000" + "showdown.clientUrl": "http://localhost:8080" +} diff --git a/build-tools/update b/build-tools/update index 4f43bd80b..bb5bf905c 100755 --- a/build-tools/update +++ b/build-tools/update @@ -82,7 +82,7 @@ if (process.argv[2] === 'full') { } catch (e) {} } -child_process.execSync(`node build-tools/babel-cli/bin/babel.js src --out-dir js --extensions ".ts,.tsx" --incremental${ignoreGraphics}`); +child_process.execSync(`node build-tools/babel-cli/bin/babel.js src --out-dir js --extensions ".ts,.tsx" --incremental${ignoreGraphics} --source-maps`); let textData = ''; try {