Vite plugin for React Native Web (RNW) that integrates RNW with Vite's dev server and build pipeline. Current stable version is 0.0.11, with active development. Release cadence is irregular. Key differentiators: provides HMR for RNW components, handles CSS-in-JS processing, and supports multiple Vite versions (4, 5, 6, 7, 8). Unlike other solutions, it directly applies RNW-specific config while leveraging Vite's React plugin. Requires react-native-web, TypeScript 5+, and Vite 4+. Includes expo-modules-core compatibility plugin since v0.0.8.
npm install vite-plugin-rnwVerified import paths — ran on the pinned version, not inferred.
Shows minimal setup to add the RNW plugin to a Vite config file.
Remove duplicate react() plugin from vite config; rely on reactNativeWebPlugin to handle it
Run 'npm install react-native-web' along with the plugin
Use import syntax or set type: 'module' in package.json
Upgrade TypeScript to version 5 or higher
npm install react-native-web
Use import reactNativeWebPlugin from 'vite-plugin-rnw'
npm install vite-plugin-rnw