Vite plugin for optimizing WorkAdventure Tiled (.tmj) maps. Version 1.2.4, released March 2026. Integrates wa-map-optimizer into Vite build pipeline: recursively discovers .tmj maps, validates structure, runs optimizer, rewrites 'script' and 'mapImage' custom properties to point to hashed Vite output. Generates HTML wrapper files for scripts. Supports configurable Play URL via options or PLAY_URL env var. Active maintenance with monthly releases.
npm install wa-map-optimizer-viteNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic setup: discovers .tmj maps from 'maps' folder, exposes scripts as Rollup entries, attaches optimizer plugins.
Ensure your map loading code expects HTML file paths for scripts (e.g., 'script.html' instead of 'script.js').
Set build.manifest: true in your Vite config.
Use Vite's 'build.outDir' to control output directory instead.
Place your map files outside 'dist' and 'node_modules', or adjust the path passed to getMaps.
To generate scripts, add a 'script' custom property in Tiled pointing to your JS/TS entry file.
Change to: import { getMaps } from 'wa-map-optimizer-vite'Run: npm install wa-map-optimizer
Add 'build.manifest: true' to your Vite config.
Verify the path passed to getMaps exists and contains .tmj files. Path is relative to project root.
No traffic data recorded yet.