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": [
|
||||
{
|
||||
"name": "Run",
|
||||
"type": "python",
|
||||
"type": "debugpy",
|
||||
"request": "launch",
|
||||
"program": "tools/run.py",
|
||||
"args": [
|
||||
// "-p",
|
||||
// "My test profile"
|
||||
],
|
||||
"console": "integratedTerminal",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"python": "${workspaceFolder}/out/pyenv/bin/python",
|
||||
@ -20,7 +24,12 @@
|
||||
"PYTHONPYCACHEPREFIX": "out/pycache",
|
||||
"ANKIDEV": "1",
|
||||
"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,
|
||||
"preLaunchTask": "ninja"
|
||||
|
@ -9,14 +9,8 @@
|
||||
"qt"
|
||||
],
|
||||
"windows": {
|
||||
"command": "bash",
|
||||
"options": {
|
||||
"env": {
|
||||
"PATH": "c:\\msys64\\usr\\bin;${env:Path}"
|
||||
}
|
||||
},
|
||||
"command": "tools/ninja.bat",
|
||||
"args": [
|
||||
"ninja",
|
||||
"pylib",
|
||||
"qt",
|
||||
"extract:win_amd64_audio"
|
||||
|
2
run.bat
2
run.bat
@ -6,6 +6,8 @@ set PYTHONPYCACHEPREFIX=out\pycache
|
||||
set ANKIDEV=1
|
||||
set QTWEBENGINE_REMOTE_DEBUGGING=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
|
||||
.\out\pyenv\scripts\python tools\run.py %* || exit /b 1
|
||||
|
@ -29,6 +29,7 @@ export default defineConfig({
|
||||
reportCompressedSize: false,
|
||||
},
|
||||
server: {
|
||||
host: "127.0.0.1",
|
||||
fs: {
|
||||
// Allow serving files project root and out dir
|
||||
allow: [
|
||||
|
Loading…
Reference in New Issue
Block a user