vite-plugin-mud

raw JSON →
2.2.23 verified Mon Apr 27 auth: no javascript

Vite plugin for MUD projects, version 2.2.23 (stable). Part of the Lattice MUD framework for building onchain games and applications on Ethereum. It integrates Vite with MUD's build pipeline, providing hot module replacement, optimized builds, and seamless compilation of MUD config, Solidity contracts, and client-side code. Compared to other bundlers, it offers out-of-the-box support for MUD's table generation and worldgen. Updated regularly with patch releases; peer dependency on Vite ^6.0.7.

error Error: Must use import to load ES Module: /path/to/node_modules/vite-plugin-mud/dist/index.js
cause CJS require() used instead of ESM import.
fix
Replace require() with import statement. Ensure your tsconfig.json has "module": "ESNext" or similar.
error TypeError: vitePluginMud is not a function
cause Default import instead of named import.
fix
Change to import { vitePluginMud } from 'vite-plugin-mud'.
error Error: Cannot find module 'vite-plugin-mud'
cause Package not installed or wrong path.
fix
Run npm install vite-plugin-mud or check the import path.
error Error: Plugin 'vite-plugin-mud' requires Vite >=6.0.7
cause Outdated Vite version.
fix
Update Vite to version 6 or later: npm install vite@^6.0.7.
breaking Removed default export; only named export provided.
fix Use named import: import { vitePluginMud } from 'vite-plugin-mud'.
breaking Dropped CJS support; package is ESM-only.
fix Use ESM imports (import/export). Ensure your project is configured for ESM.
breaking Peer dependency on Vite ^6.0.7; incompatible with older Vite versions.
fix Upgrade Vite to version 6 or later.
deprecated The 'mudConfig' export is deprecated; use 'defineConfig' instead.
fix Replace import { mudConfig } with import { defineConfig } from 'vite-plugin-mud'.
npm install vite-plugin-mud
yarn add vite-plugin-mud
pnpm add vite-plugin-mud

Basic setup of vite-plugin-mud in a Vite config file, enabling MUD integration.

// vite.config.ts
import { defineConfig } from 'vite';
import { vitePluginMud } from 'vite-plugin-mud';

export default defineConfig({
  plugins: [
    vitePluginMud({
      worldAddress: process.env.WORLD_ADDRESS ?? '0x0000000000000000000000000000000000000000',
    }),
  ],
});