Remix finalized the Vite build process, improved static site generation, enabled split server bundles and enhanced control over client-only and server-only separation
The premier improvement is that Remix 2.7 stabilizes the Vite build process.
Other new features include:
- SPA Mode: Remix now supports building static sites that don’t require a JavaScript server, maintaining features like automatic code splitting and route module prefetching.
- Remix now supports Vite’s basename feature, allowing running Remix from a subdirectory.
- Cloudflare Pages Support: A new Vite plugin integrates Cloudflare’s tooling with Remix for static sizes.
- Split Server Bundles: Thanks to work at Vercel, Remix’s build system allows splitting server bundles across routes.
- Better Server and Client Separation: Improvements have been made to prevent server-only code from ending up in client builds, with compile-time errors now raised for any such occurrences.
vite-env-only
Plugin: A standalone Vite plugin allows marking expressions as server-only or client-only, enhancing code safety and flexibility..css?url
Imports: Appending?url
to CSS imports allows support for pre- and post-processing with PostCSS, Tailwind, CSS Modules, SASS and others.- Build directory: instead of
public/build
andbuild
folders, Remix now usesbuild/client
andbuild/server
.
View the release announcement.