Registry / devops / js13k-vite-plugins

js13k-vite-plugins

JSON →
library1.0.3jsnpmunverified

A collection of Vite plugins specifically designed for optimizing JavaScript and assets for the js13kGames competition (13KB size limit). Current stable version 1.0.3, maintained actively with Node.js ^22.18.0 || >=24.2.0. Integrates TypeScript, Rolldown builds, Imagemin, Shader Minifier, Roadroller JS compressor, ECT ZIP compression, and Advzip post-processing. Provides a convenience wrapper js13kViteConfig() for quick setup, but also exports individual plugins for fine-grained control. Requires Vite ^8.0.0 and Terser ^5.0.0 as peer dependencies. Ships TypeScript types. Differentiators: opinionated defaults tuned for the 13KB constraint; includes ECT and Advzip for final ZIP size reduction; designed specifically for game jams.

npm install js13k-vite-plugins
INSTALL
IMPORT
SIG · JS13K-VITE-PLUGINS
J
js13k-vite-plugins
devopsjavascriptv1.0.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

js13kViteConfig
import { js13kViteConfig } from 'js13k-vite-plugins'
const js13kViteConfig = require('js13k-vite-plugins')
ESM-only package; requires Vite ^8.0.0. Use named import. CommonJS require() will fail.
advzipPlugin
import { advzipPlugin } from 'js13k-vite-plugins'
import advzipPlugin from 'js13k-vite-plugins'
Named export, not default. Available for individual plugin usage.
getDefaultViteBuildOptions
import { getDefaultViteBuildOptions } from 'js13k-vite-plugins'
Utility function to get default Vite build options; used in manual configurations.

Minimal Vite config using the recommended all-in-one helper for js13kGames.

import { js13kViteConfig } from 'js13k-vite-plugins'; import { defineConfig } from 'vite'; export default defineConfig(js13kViteConfig());
Debug
Known issues
breakingRequires Node.js ^22.18.0 or >=24.2.0. Older Node versions will fail to run.
fix
Upgrade Node.js to version 22.18.0 or later (or 24.2.0+).
affects: <22.18.0 or <24.2.0
breakingRequires Vite ^8.0.0. Projects on Vite 5.x or older must upgrade.
fix
Update Vite to ^8.0.0 in your package.json.
affects: <8.0.0
breakingPackage is ESM-only. CommonJS (require) will throw an error.
fix
Use import syntax and ensure your project is configured for ESM (e.g., type: module in package.json).
affects: >=1.0.0
deprecatedThe Terser minification options may change in future versions as the plugin migrates to Rolldown.
fix
Monitor release notes for changes; consider explicitly setting terserOptions if you depend on specific minification behavior.
affects: >=1.0.0
gotchaExternal compressors (ECT, Advzip, Roadroller) must be installed separately on the system; the plugin will fail silently if not found.
fix
Ensure ECT, advzip, and Roadroller are available in PATH, or disable those plugins via options.
affects: >=1.0.0
gotchaThe default advzipOptions shrink level is 'insane' which may be extremely slow.
fix
Set advzipOptions.shrinkLevel to 'fast' or 'normal' for faster builds.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Dynamic require of "js13k-vite-plugins" is not supported
Using CommonJS require() on an ESM-only package.
fix
Replace require() with import: import { js13kViteConfig } from 'js13k-vite-plugins';
ERR_REQUIRE_ESM: require() of ES Module
Using require() in a CJS context.
fix
Set "type": "module" in package.json and use import statements.
Cannot find module 'terser'
Missing peer dependency terser.
fix
Run: npm install --save-dev terser
Error: ECT compression failed: No such file or directory
ECT binary not installed or not in PATH.
fix
Install ECT (efficient-compression-tool) or disable via ectOptions: false.
Upgrade
Version history
1.0.3latest on npm
Audit
Dependencies
terserrequiredPeer dependency for JavaScript minification.
viterequiredPeer dependency; the plugins are Vite plugins.
Agent activity
7 hits · last 30 days
node
6
Resources
js13k-vite-plugins — npm install js13k-vite-plugins · libregistry