Open
Description
Description
The feature allow browser to cache npm deps
deps is very useful, but it has a problem like this repo
reproduction steps:
- Download repo and
pnpm install
- Start vite dev-server
- In browser, access
http://localhost:5173/
- wait for page loaded
- make sure
devtools=>Network=> disable cache
not checked! - restart vite dev-ser
- wait for browser load page
Browser page will display errors.
Suggested solution
When send cached request, allow user define a callback or RegExp to disable some npm deps' cache
A possibly implementation:
defineConfig({
server:{
npmCacheStrategy(url){
return url.indexOf('?')<0
}
}
})
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.