Documentation is
Explain in Detail
The documentation clearly explains dependency pre-bundling and caching behavior in development mode, but is unclear about what caching behavior (if any) should be expected during production builds.
Currently, we can observe that:
- Development mode uses the
.vite cache directory for dependency pre-bundling
- Production builds appear to rebuild/transform all modules each time
- The
cacheDir config option exists but its impact on production builds is not documented
This creates uncertainty when:
- Planning CI/CD pipelines
- Trying to optimize build times
- Deciding whether to pursue other optimization strategies
Your Suggestion for Changes
Add a section in the Production build documentation that explicitly describes:
- Expected caching behavior in production builds
- How caching differs between development and production
- Whether any caching between production builds is possible/intended
- If no caching is intended for production, explain the reasoning
This would help teams better understand what to expect and how to optimize their build processes.
Reproduction
No response
Steps to reproduce
- Create new Vite project (
npm create vite@latest)
- Run production build:
npm run build
- Run production build again without changes
- Observe that all modules are transformed again
- Check
.vite directory - no cached artifacts from production builds
The behavior itself works, but its documentation is unclear about whether this is expected, or can be improved.
Documentation is
Explain in Detail
The documentation clearly explains dependency pre-bundling and caching behavior in development mode, but is unclear about what caching behavior (if any) should be expected during production builds.
Currently, we can observe that:
.vitecache directory for dependency pre-bundlingcacheDirconfig option exists but its impact on production builds is not documentedThis creates uncertainty when:
Your Suggestion for Changes
Add a section in the Production build documentation that explicitly describes:
This would help teams better understand what to expect and how to optimize their build processes.
Reproduction
No response
Steps to reproduce
npm create vite@latest)npm run build.vitedirectory - no cached artifacts from production buildsThe behavior itself works, but its documentation is unclear about whether this is expected, or can be improved.