目錄
lunch.json創建
vite.config.ts
打斷點運行
lunch.json創建
首先,點擊VSCode左上角,甲殼蟲運行的按鈕,然后點擊運行與調試,選擇chrome瀏覽器,修改成一下配置。
{
? // 使用 IntelliSense 了解相關屬性。
? // 懸停以查看現有屬性的描述。
? // 欲了解更多信息,請訪問: https://go.microsoft.com/fwlink/?linkid=830387
? "version": "0.2.0",
? "configurations": [
? ? {
? ? ? "type": "chrome",
? ? ? "request": "launch",
? ? ? "name": "dev",
? ? ? "url": "http://localhost:5173/",
? ? ? "webRoot": "${workspaceFolder}/src",
? ? ? "sourceMaps": true,
? ? ? "runtimeExecutable":"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
? ? }
? ]
}
vite.config.ts
defineConfig({ build: { sourcemap: true } })