Using import.meta.url
in vite.config.ts
shows error in IDE (VS Code)
#6311
Labels
import.meta.url
in vite.config.ts
shows error in IDE (VS Code)
#6311
Describe the bug
If you create a brand new Vite app and add
console.log(import.meta.url)
tovite.config.ts
, you'll see an error in VS Code:Adding
vite.config.ts
totsconfig.json
'sinclude
array solves the issue but I wonder if there's any downsides to doing this by default. One I can think of is thatvite.config.ts
can rely on Node.js stuff buttsconfig.json
is primarily for the browser environment if I'm not mistaken.Bear in mind that StackBlitz won't show you this, you'll need to download the project and open it locally.
Reproduction
https://stackblitz.com/edit/vitejs-vite-yv42yg?file=vite.config.ts
System Info
Used Package Manager
yarn
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: