VSCode extension for enabling hot reload when coding webview.
- Set environment variable
IS_EXTENSION_DEBUGGING
astrue
to extension'slaunch.json
wanted to use hot reload.
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspacIS_EXTENSION_DEBUGGINGeFolder}"
],
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}",
+ "env": {
+ "IS_EXTENSION_DEBUGGING": "true"
+ }
},
-
Set folder of webview code as
vscode-webview-hotreload.watchFolder
. (ex."vscode-webview-hotreload.watchFolder": "c:\\User\\Desktop\\ExtensionProject"
) -
Start debug session and active webview.
-
If you changed webview code, webview will reload.