Next Vue to React intelligent compilation toolchain that compiles Vue 3 into runnable React 18+ code
English | 简体中文
VuReact is not just a simple syntax conversion tool, but a convention-based intelligent compilation platform. We adhere to the principle of "controllability over full coverage," providing a predictable, analyzable, and maintainable engineering path for Vue to React migration through explicit compilation conventions.
Furthermore, VuReact is not only suitable for migration scenarios but also for development scenarios where developers wish to enjoy Vue's excellent mental model while producing React code.
⚖️ Progressive Migration
🧭 Convention Driven
🌀 Cross-Framework Bridge
🏆 Proof of Concept
🔄 Modern Vue First
📋 Template to JSX
⚛️ Core Feature Adaptation
🎨 Zero Runtime CSS
🔬 Fine-Grained Processing
📝 TypeScript Ready
⚡ CLI & Watch Mode
📁 Project-Level Build
🛠️ Vite Integration
For detailed usage guides and API documentation, please visit the official VuReact website:
npm install -D @vureact/compiler-core
# or
yarn add -D @vureact/compiler-core
# or
pnpm add -D @vureact/compiler-core
Create vureact.config.js:
import { defineConfig } from '@vureact/compiler-core';
export default defineConfig({
input: 'src',
cache: true,
exclude: ['src/main.ts'], // Exclude Vue entry file
output: {
workspace: '.vureact',
outDir: 'react-app',
bootstrapVite: true,
},
});
In practice, except for exclude (which must be specified manually), all other options use the default values shown above and require no additional configuration.
# One-time build
npx vureact build
# Watch mode (recommended for development)
npx vureact watch
<template>
<div :class="$style['hello-container']">
<h1>{{ greetingMessage }}</h1>
<p>Counter: {{ count }}</p>
<button @click="increment">Click me to increase</button>
</div>
</template>
<script setup lang="ts">
import { computed, onMounted, ref } from 'vue';
const count = ref<number>(0);
const name = ref('Vue 3');
const greetingMessage = computed(() => {
return `Hello, welcome to the world of ${name.value}!`;
});
const increment = () => {
count.value++;
};
onMounted(() => {
console.log('Component mounted!');
});
</script>
<style module scoped>
.hello-container {
padding: 20px;
border: 1px solid #42b883;
border-radius: 8px;
}
</style>
import { useCallback, memo } from 'react';
import { useComputed, useMounted, useVRef } from '@vureact/runtime-core';
import $style from './counter-159e8f98.module.css';
const Counter = memo(() => {
const count = useVRef<number>(0);
const name = useVRef('Vue 3');
const greetingMessage = useComputed(() => {
return `Hello, welcome to the world of ${name.value}!`;
});
const increment = useCallback(() => {
count.value++;
}, [count.value]);
useMounted(() => {
console.log('Component mounted!');
});
return (
<div className={$style['hello-container']} data-css-159e8f98>
<h1 data-css-159e8f98>{greetingMessage.value}</h1>
<p data-css-159e8f98>Counter: {count.value}</p>
<button onClick={increment} data-css-159e8f98>
Click me to increase
</button>
</div>
);
});
export default Counter;
Generated CSS file:
.hello-container[data-css-159e8f98] {
padding: 20px;
border: 1px solid #42b883;
border-radius: 8px;
}
To ensure transformation quality, please follow these conventions:
inputsrc/main.ts)<script setup>defineProps / defineEmits / defineSlots / defineOptions must be top-level onlyuse* call that will be converted into React Hooks must remain at the top levelv-else / v-else-if must be adjacent to the previous conditional branch<style> block is supported; multiple blocks will trigger warningsscoped and module are supported but must follow conventions# Build project
npx vureact build
# Watch mode
npx vureact watch
# Show help
npx vureact --help
my-project/
├── src/ # Original Vue source code
│ ├── components/
│ │ └── Counter.vue
│ └── main.ts
├── .vureact/ # Workspace (generated)
│ ├── react-app/ # Generated React project
│ │ ├── src/
│ │ │ ├── components/
│ │ │ │ ├── Counter.tsx
│ │ │ │ └── counter-[hash].css
│ │ │ └── main.tsx
│ │ └── package.json
│ └── cache/ # Compilation cache
└── vureact.config.js # Configuration file
Runtime Adapter Package Provides React-compatible implementations of Vue core APIs. https://runtime.vureact.top
Router Adapter Package Supports Vue Router → React Router transformation. https://router.vureact.top
Full Documentation Detailed usage guides and API references. https://vureact.top
<script setup>Issues and Pull Requests are welcome! Please read the contribution guide first: CONTRIBUTING.md
MIT License © 2025 Ruihong Zhong (Ryan John)
VuReact’s continued development depends on community support. Your sponsorship directly supports maintenance, feature development, and documentation improvements, helping push the technical boundaries of Vue-to-React compilation.
Platform: afdian
VuReact — Validating the feasibility of full Vue-to-React compilation through innovative compilation architecture and runtime adaptation, achieving unprecedented transformation depth and engineering completeness.