I create a vue project use vite. I can debugger file in src folder. But i can’t debugger file outside src folder, like vite.config.ts
.
Below is launch.json.
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Chrome",
"request": "launch",
"type": "chrome",
"url": "http://localhost:5173",
"webRoot": "${workspaceFolder}"
}
]
}
I want add a debugger on plugins: [vue()]
in vite.config.ts. It doesn’t work. This is my vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
console.log('vite.config.ts')
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()], // add a debugger here
})
This is my tsconfig.json.
{
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"module": "ESNext",
"moduleResolution": "Node",
"strict": true,
"jsx": "preserve",
"resolveJsonModule": true,
"isolatedModules": true,
"esModuleInterop": true,
"lib": ["ESNext", "DOM"],
"skipLibCheck": true,
"noEmit": true,
"sourceMap": true
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
"references": [{ "path": "./tsconfig.node.json" }]
}
This is my tsconfig.node.json
{
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
}
How could make debugger vite.config.ts
work, thanks