Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear Documentation: Production vs Development Caching Behavior #19214

Open
2 of 4 tasks
CodySchaaf opened this issue Jan 16, 2025 · 0 comments
Open
2 of 4 tasks

Unclear Documentation: Production vs Development Caching Behavior #19214

CodySchaaf opened this issue Jan 16, 2025 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@CodySchaaf
Copy link

Documentation is

  • Missing
  • Outdated
  • Confusing
  • Not sure?

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:

  1. Expected caching behavior in production builds
  2. How caching differs between development and production
  3. Whether any caching between production builds is possible/intended
  4. 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

  1. Create new Vite project (npm create vite@latest)
  2. Run production build: npm run build
  3. Run production build again without changes
  4. Observe that all modules are transformed again
  5. 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.

@CodySchaaf CodySchaaf added the documentation Improvements or additions to documentation label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant