mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 15:04:52 +09:00
Replace webpack and Module Federation with Vite 8. The controller build emits one entry per shared module (lib, web_ui, typebox, antd, react, react-dom, react-router) and lists them in manifest.json. The controller turns that into an import map in index.html, and plugins are built as ES modules that import the shared modules by name and are loaded with import(). The shared Vite setup lives in @clusterio/web_ui/vite.mjs. Plugins use clusterioPlugin(), which exposes index, package.json and web/index under the same keys the webpack template used. The --dev and --dev-plugin flags now run the Vite dev server in middleware mode with hot module replacement. Browser polyfills move from web_ui to lib, which is the code that needs them, and lib sets the process and Buffer globals itself. Refs #1127 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
10 lines
467 B
TypeScript
10 lines
467 B
TypeScript
import type { Plugin, PluginOption } from "vite";
|
|
|
|
export const sharedModules: string[];
|
|
export function devUrl(id: string): string;
|
|
export function devSharedUrl(name: string): string;
|
|
export function devPluginUrl(name: string): string;
|
|
export function clusterioApp(options: { entry: string }): PluginOption[];
|
|
export function clusterioDevPlugins(pluginDirs: Map<string, string>): Plugin;
|
|
export function clusterioPlugin(options?: { root?: string }): PluginOption[];
|