weapp-vite
Vite builds for mini-app projects
Owns dependencies, routes, subpackages, and single-target multi-platform builds. Keep your page structure; hand the build pipeline to Vite.
import { defineConfig } from 'weapp-vite'
export default defineConfig({
weapp: {
multiPlatform: {
enabled: true,
targets: ['weapp'],
},
},
})dist/weapp/dist/index.wxmlindex.wxssindex.jsindex.json
pnpm exec wv build -p weapp<button
class="bg-emerald-700 text-white
rounded-md px-6 py-3
font-medium">
Start building
</button>pnpm dlx @varo-ui/cli add \
--target weapp \
button input cardStatic code example · no database is running
// Register weappSqlite() in vite.config.ts first
// Static code example · no database runs on this page
import { openSqlite } from '@weapp-sqlite/weapp-vite/runtime'
const db = await openSqlite({ name: 'app.sqlite' })
try {
const result = await db.query(
'SELECT ? AS message', ['hello'],
)
console.log(result.rows)
}
finally {
await db.close()
}npm create vite-taro@latest my-app
# Reuse React and Taro components and APIs
# Official HMR demo: heading updated, counter still at 5


