( 1 )创建项目: npm create vite@latest vue3_vite_js -- --template vue
( 2 )修改 vite.config.js
export default defineConfig({
build: {
sourcemap: false,
minify: false
},
......
})
( 3 )新增 launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:5173",
"sourceMaps": true,
"webRoot": "${workspaceFolder}"
}
]
}
( 4 ) npm run dev 然后下个断点,:

( 5 )启动 launch.json 的调试,结果断点断到了 localhost:5173\src\main.js 而不是源文件:

是哪个步骤出问题了,希望大佬不吝赐教 (项目文件在: https://github.com/wjx0912/frontend_debug/tree/main/vue3_vite_js )