A Vite plugin that enables developers to build Shopify themes using React components. It compiles React sections, blocks, snippets, and templates into Shopify Liquid files at build time via SSG (Static Site Generation). The runtime handles hydration, providing a full React development experience while maintaining Shopify compatibility. Current version 2.2.9 requires Vite ^8.0.0. Three key differentiators: (1) AI-friendly — developers can leverage React/TypeScript which LLMs understand better than Liquid; (2) testability — React components can be unit-tested with Jest/Vitest; (3) modern tooling — TypeScript, tree-shaking, and component-based architecture. Actively maintained on GitHub with weekly release cadence.
npm install vite-plugin-react-shopifyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures Vite plugin and defines a Shopify section component with settings.
Upgrade Vite to ^8.0.0 or stick with v1.x of the plugin.
Change imports: import { useSectionSettings } from 'vite-plugin-react-shopify/runtime'Use ssg: { prefix: { section: 'r-', ... } }Place shared components in frontend/components/ and import them with relative paths like './components/SharedCard'.
Configure a custom prefix in ssg.prefix to avoid name collisions.
Use useEffect or lazy loading for browser-specific logic.
Upgrade to v2.2.9: pnpm add vite-plugin-react-shopify@latest
Upgrade Vite to ^8.0.0: pnpm add vite@^8.0.0
Change to ES module import: import vitePluginShopify from 'vite-plugin-react-shopify'
Install react and react-dom: pnpm add react react-dom