meteor-vite
raw JSON → 3.8.0 verified Mon Apr 27 auth: no javascript
meteor-vite integrates Vite with Meteor 3.x, providing an alternative to Meteor's built-in build system. Version 3.8.0 supports Vite 6 and requires Node 20+. It enables fast HMR, ES module imports, and TypeScript support within Meteor projects. Major differentiator: allows using Vite's plugin ecosystem and modern tooling while leveraging Meteor's full-stack framework.
Common errors
error Cannot find module 'vite' ↓
cause vite not installed or incorrect version
fix
meteor npm install vite@^6.0.0
error Error: The package `vite` is not a peer dependency of `meteor-vite` ↓
cause Vite version mismatch
fix
Update vite to ^6.0.0
error TypeError: meteorVite is not a function ↓
cause Incorrect import: using default import without default export
fix
Use
import meteorVite from 'meteor-vite' Warnings
breaking Requires Meteor 3 and Node >=20.0.0 ↓
fix Upgrade to Meteor 3 and Node 20+
breaking Peer dependency vite ^6.0.0, not compatible with earlier Vite versions ↓
fix Update vite to ^6.0.0
gotcha Do not manually import virtual modules like '/client/main.jsx' - meteor-vite handles entry point ↓
fix Let meteor-vite configure the entry point automatically
Install
npm install meteor-vite yarn add meteor-vite pnpm add meteor-vite Imports
- default wrong
const meteorVite = require('meteor-vite')correctimport meteorVite from 'meteor-vite' - defineConfig wrong
import { defineConfig } from 'meteor-vite/plugin'correctimport { defineConfig } from 'meteor-vite' - withVite wrong
const { withVite } = Meteorcorrectimport { withVite } from 'meteor-vite'
Quickstart
// install: meteor npm install meteor-vite vite
// create vite.config.ts in project root
import meteorVite from 'meteor-vite';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [meteorVite()],
// optional: configure Vite options
resolve: {
alias: {
'/imports': '/imports',
},
},
});