@magelight/vite-plugin
v0.28.6
Published
Vite plugin for Magelight UI pages: file:// safe output, per-entry pruned view folders, crossorigin strip.
Readme
@magelight/vite-plugin
// vite.config.ts
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { magelight } from '@magelight/vite-plugin';
export default defineConfig({
plugins: [react(), magelight({ entries: { config: 'index.html', hud: 'hud.html' } })],
});vite build then writes views/config/index.html and views/hud/index.html, each with only the
assets that page reaches, ready to be named from manifest.json ("path": "views/config/index.html").
What it sets for you: base: './' (file:// loading), es2022 output (Ultralight 1.4's WebKit
615; es2019 was the 1.3-era rule), no crossorigin on module tags (a null origin refuses CORS
loads → blank page), no modulepreload polyfill, per-entry pruning (the rule SeverActions'
build-ui.ps1 enforced by hand).
Options: entries, viewsDir (views), single (index), outDir (dist), keepDist.
