HMR on Windows (#3144)
* Enable hot module reloading on Windows * Update VSC launch.json and tasks.json * Bind vite server to 127.0.0.1 (dae) Our frontend connects via IP, and on Windows, this fails if the server is bound to 'localhost' instead.
This commit is contained in:
parent
0a706c5dd9
commit
ebc6c0847a
@ -6,9 +6,13 @@
|
|||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"name": "Run",
|
"name": "Run",
|
||||||
"type": "python",
|
"type": "debugpy",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "tools/run.py",
|
"program": "tools/run.py",
|
||||||
|
"args": [
|
||||||
|
// "-p",
|
||||||
|
// "My test profile"
|
||||||
|
],
|
||||||
"console": "integratedTerminal",
|
"console": "integratedTerminal",
|
||||||
"cwd": "${workspaceFolder}",
|
"cwd": "${workspaceFolder}",
|
||||||
"python": "${workspaceFolder}/out/pyenv/bin/python",
|
"python": "${workspaceFolder}/out/pyenv/bin/python",
|
||||||
@ -20,7 +24,12 @@
|
|||||||
"PYTHONPYCACHEPREFIX": "out/pycache",
|
"PYTHONPYCACHEPREFIX": "out/pycache",
|
||||||
"ANKIDEV": "1",
|
"ANKIDEV": "1",
|
||||||
"QTWEBENGINE_REMOTE_DEBUGGING": "8080",
|
"QTWEBENGINE_REMOTE_DEBUGGING": "8080",
|
||||||
"QTWEBENGINE_CHROMIUM_FLAGS": "--remote-allow-origins=http://localhost:8080"
|
"QTWEBENGINE_CHROMIUM_FLAGS": "--remote-allow-origins=http://localhost:8080",
|
||||||
|
"RUST_BACKTRACE": "1",
|
||||||
|
// "TRACESQL": "1",
|
||||||
|
// "HMR": "1",
|
||||||
|
"ANKI_API_PORT": "40000",
|
||||||
|
"ANKI_API_HOST": "127.0.0.1"
|
||||||
},
|
},
|
||||||
"justMyCode": true,
|
"justMyCode": true,
|
||||||
"preLaunchTask": "ninja"
|
"preLaunchTask": "ninja"
|
||||||
|
@ -9,14 +9,8 @@
|
|||||||
"qt"
|
"qt"
|
||||||
],
|
],
|
||||||
"windows": {
|
"windows": {
|
||||||
"command": "bash",
|
"command": "tools/ninja.bat",
|
||||||
"options": {
|
|
||||||
"env": {
|
|
||||||
"PATH": "c:\\msys64\\usr\\bin;${env:Path}"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"args": [
|
"args": [
|
||||||
"ninja",
|
|
||||||
"pylib",
|
"pylib",
|
||||||
"qt",
|
"qt",
|
||||||
"extract:win_amd64_audio"
|
"extract:win_amd64_audio"
|
||||||
|
2
run.bat
2
run.bat
@ -6,6 +6,8 @@ set PYTHONPYCACHEPREFIX=out\pycache
|
|||||||
set ANKIDEV=1
|
set ANKIDEV=1
|
||||||
set QTWEBENGINE_REMOTE_DEBUGGING=8080
|
set QTWEBENGINE_REMOTE_DEBUGGING=8080
|
||||||
set QTWEBENGINE_CHROMIUM_FLAGS=--remote-allow-origins=http://localhost:8080
|
set QTWEBENGINE_CHROMIUM_FLAGS=--remote-allow-origins=http://localhost:8080
|
||||||
|
set ANKI_API_PORT=40000
|
||||||
|
set ANKI_API_HOST=127.0.0.1
|
||||||
|
|
||||||
call tools\ninja pylib qt extract:win_amd64_audio || exit /b 1
|
call tools\ninja pylib qt extract:win_amd64_audio || exit /b 1
|
||||||
.\out\pyenv\scripts\python tools\run.py %* || exit /b 1
|
.\out\pyenv\scripts\python tools\run.py %* || exit /b 1
|
||||||
|
@ -29,6 +29,7 @@ export default defineConfig({
|
|||||||
reportCompressedSize: false,
|
reportCompressedSize: false,
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
|
host: "127.0.0.1",
|
||||||
fs: {
|
fs: {
|
||||||
// Allow serving files project root and out dir
|
// Allow serving files project root and out dir
|
||||||
allow: [
|
allow: [
|
||||||
|
Loading…
Reference in New Issue
Block a user