{"id":22750,"library":"vite-plugin-mud","title":"vite-plugin-mud","description":"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.","status":"active","version":"2.2.23","language":"javascript","source_language":"en","source_url":"https://github.com/latticexyz/mud","tags":["javascript"],"install":[{"cmd":"npm install vite-plugin-mud","lang":"bash","label":"npm"},{"cmd":"yarn add vite-plugin-mud","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-plugin-mud","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Named export, not default.","wrong":"import vitePluginMud from 'vite-plugin-mud'","symbol":"vitePluginMud","correct":"import { vitePluginMud } from 'vite-plugin-mud'"},{"note":"ESM only; no CJS require support.","wrong":"const { mudConfig } = require('vite-plugin-mud')","symbol":"mudConfig","correct":"import { mudConfig } from 'vite-plugin-mud'"},{"note":"Must use ESM import, not require.","wrong":"const defineConfig = require('vite-plugin-mud').defineConfig","symbol":"defineConfig","correct":"import { defineConfig } from 'vite-plugin-mud'"}],"quickstart":{"code":"// vite.config.ts\nimport { defineConfig } from 'vite';\nimport { vitePluginMud } from 'vite-plugin-mud';\n\nexport default defineConfig({\n  plugins: [\n    vitePluginMud({\n      worldAddress: process.env.WORLD_ADDRESS ?? '0x0000000000000000000000000000000000000000',\n    }),\n  ],\n});","lang":"typescript","description":"Basic setup of vite-plugin-mud in a Vite config file, enabling MUD integration."},"warnings":[{"fix":"Use named import: import { vitePluginMud } from 'vite-plugin-mud'.","message":"Removed default export; only named export provided.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use ESM imports (import/export). Ensure your project is configured for ESM.","message":"Dropped CJS support; package is ESM-only.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Upgrade Vite to version 6 or later.","message":"Peer dependency on Vite ^6.0.7; incompatible with older Vite versions.","severity":"breaking","affected_versions":">=2.2.0"},{"fix":"Replace import { mudConfig } with import { defineConfig } from 'vite-plugin-mud'.","message":"The 'mudConfig' export is deprecated; use 'defineConfig' instead.","severity":"deprecated","affected_versions":">=2.2.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Replace require() with import statement. Ensure your tsconfig.json has \"module\": \"ESNext\" or similar.","cause":"CJS require() used instead of ESM import.","error":"Error: Must use import to load ES Module: /path/to/node_modules/vite-plugin-mud/dist/index.js"},{"fix":"Change to import { vitePluginMud } from 'vite-plugin-mud'.","cause":"Default import instead of named import.","error":"TypeError: vitePluginMud is not a function"},{"fix":"Run `npm install vite-plugin-mud` or check the import path.","cause":"Package not installed or wrong path.","error":"Error: Cannot find module 'vite-plugin-mud'"},{"fix":"Update Vite to version 6 or later: `npm install vite@^6.0.7`.","cause":"Outdated Vite version.","error":"Error: Plugin 'vite-plugin-mud' requires Vite >=6.0.7"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}