v7.0.0-beta.0
Breaking Changes📦 vite
⚠ 4 breaking✨ 4 features🐛 3 fixes⚡ 2 deprecations🔧 6 symbols
Summary
Vite 7.0.0-beta.0 introduces the new Environment API and drops support for legacy Node.js versions, focusing on ESM performance and modern web standards.
⚠️ Breaking Changes
- Vite now requires Node.js 18, 20, or 22+. Support for Node.js 12, 14, 16, and 17 has been dropped.
- The CJS build of Vite is deprecated. Users should migrate to ESM.
- The default value for 'resolve.conditions' now includes 'module' by default.
- CSS is now emitted as separate assets by default in library mode unless 'cssCodeSplit' is false.
Migration Steps
- Convert vite.config.js to vite.config.mjs or set 'type': 'module' in package.json.
- Check CSS imports in library mode to ensure styles are still being loaded correctly.
- Review custom plugins for compatibility with the new Environment API.
✨ New Features
- Support for Environment API, allowing different configurations for SSR, Worklets, and more.
- Improved support for CSS modules with lightningcss integration.
- Enhanced HMR performance for large-scale projects.
- Support for TypeScript 5.x features out of the box.
🐛 Bug Fixes
- Fixes issues with circular dependencies in optimized dependencies.
- Corrects sourcemap paths when using base URL with nested assets.
- Resolves race conditions during rapid HMR updates.
🔧 Affected Symbols
createServerbuildresolve.conditionscssCodeSplitModuleGraphHMRContext⚡ Deprecations
- CommonJS API (vite.bundle, vite.build, etc.) is deprecated in favor of ESM.
- The 'resolvePackageEntry' and 'resolvePackageData' internal APIs are deprecated.