{"_id":"@djodjonx/gwen-vite-plugin","_rev":"6-885661b70c030bf994e04f3aa27ee33e","name":"@djodjonx/gwen-vite-plugin","dist-tags":{"latest":"1.0.0"},"versions":{"0.1.0":{"name":"@djodjonx/gwen-vite-plugin","version":"0.1.0","_id":"@djodjonx/gwen-vite-plugin@0.1.0","maintainers":[{"name":"djodjonx","email":"djo.moutier@gmail.com"}],"dist":{"shasum":"89c2911c9b28bccbba715fe7256d640ba973b714","tarball":"https://registry.npmjs.org/@djodjonx/gwen-vite-plugin/-/gwen-vite-plugin-0.1.0.tgz","fileCount":5,"integrity":"sha512-SyNoA5N8/PeDrD9Q4T1Khkaxqltm4coyqej3RKK9ATnZtP+2/0HeBBspVl11qMAZGuB/YdboC8IepEsmzFFRDQ==","signatures":[{"sig":"MEQCIFMhNJIrkNM9nUtzBHZ2EeOZZPWylHBxDJ0YatFm7eABAiA8NdPVHGdbcboNvC0j7m3YfeIj7UFOZP4zH0B514v5/w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32802},"main":"./dist/index.js","type":"module","_from":"file:djodjonx-gwen-vite-plugin-0.1.0.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","development":"./src/index.ts"}},"scripts":{"dev":"vite build --watch","test":"vitest run","build":"vite build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"djodjonx","email":"djo.moutier@gmail.com"},"_resolved":"/private/var/folders/vc/41dnkkc11kqfyrhq8hmhj9400000gn/T/7e9282d71b613e6bf7f6f05d26aef1fa/djodjonx-gwen-vite-plugin-0.1.0.tgz","_integrity":"sha512-SyNoA5N8/PeDrD9Q4T1Khkaxqltm4coyqej3RKK9ATnZtP+2/0HeBBspVl11qMAZGuB/YdboC8IepEsmzFFRDQ==","_npmVersion":"10.9.4","description":"Vite plugin for GWEN — WASM hot-reload, asset copying, manifest injection","directories":{},"_nodeVersion":"22.21.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^7.3.1","vitest":"^4.0.18","typescript":"^5.9.3","vite-plugin-dts":"^4.5.4"},"peerDependencies":{"vite":"^7.3.1"},"_npmOperationalInternal":{"tmp":"tmp/gwen-vite-plugin_0.1.0_1773050185841_0.770926741974707","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@djodjonx/gwen-vite-plugin","version":"0.1.1","_id":"@djodjonx/gwen-vite-plugin@0.1.1","maintainers":[{"name":"djodjonx","email":"djo.moutier@gmail.com"}],"dist":{"shasum":"b81116c991de34c77cf56bec3478476d397a52a3","tarball":"https://registry.npmjs.org/@djodjonx/gwen-vite-plugin/-/gwen-vite-plugin-0.1.1.tgz","fileCount":5,"integrity":"sha512-PXxaHgJ5EEXP/eGZPX67UhgSeZjwxvQzbGQgrmBPx4rDL5Av3IGpSIbp1Ub6f7uBv6ay61HoFEEoxVm51SiR5Q==","signatures":[{"sig":"MEYCIQD9tantX9v8PC+DPwvk2hBXY7Bxu+0z1lhuPsNlqV8K5AIhAN3hrsx1TK2gOfekx30kjTzXYYCRTghuvNo1IevXUCpY","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32802},"main":"./dist/index.js","type":"module","_from":"file:djodjonx-gwen-vite-plugin-0.1.1.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","development":"./src/index.ts"}},"scripts":{"dev":"vite build --watch","test":"vitest run","build":"vite build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"djodjonx","email":"djo.moutier@gmail.com"},"_resolved":"/private/var/folders/vc/41dnkkc11kqfyrhq8hmhj9400000gn/T/1492a8eebf6dd118b5ae2db86c3e4295/djodjonx-gwen-vite-plugin-0.1.1.tgz","_integrity":"sha512-PXxaHgJ5EEXP/eGZPX67UhgSeZjwxvQzbGQgrmBPx4rDL5Av3IGpSIbp1Ub6f7uBv6ay61HoFEEoxVm51SiR5Q==","_npmVersion":"10.9.4","description":"Vite plugin for GWEN — WASM hot-reload, asset copying, manifest injection","directories":{},"_nodeVersion":"22.21.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^7.3.1","vitest":"^4.0.18","typescript":"^5.9.3","vite-plugin-dts":"^4.5.4"},"peerDependencies":{"vite":"^7.3.1"},"_npmOperationalInternal":{"tmp":"tmp/gwen-vite-plugin_0.1.1_1773052961263_0.9354505817136358","host":"s3://npm-registry-packages-npm-production"}},"0.3.5":{"name":"@djodjonx/gwen-vite-plugin","version":"0.3.5","_id":"@djodjonx/gwen-vite-plugin@0.3.5","maintainers":[{"name":"djodjonx","email":"djo.moutier@gmail.com"}],"dist":{"shasum":"eeeb1d92aa616cd4725dd7bf730c3adec65a45d0","tarball":"https://registry.npmjs.org/@djodjonx/gwen-vite-plugin/-/gwen-vite-plugin-0.3.5.tgz","fileCount":5,"integrity":"sha512-TEcVj3Jq0BKITXAbgVXXvooonzwkYue0sHOjrnLvJ0CVrGKTv6ycm01j6CHWOp1FMbI30/H2hMcCder2do6stw==","signatures":[{"sig":"MEYCIQDtNJWbABFJMS6JReY517AaELMrjfBKJMdbOtixDfM/dgIhANd9sxYvvVM1nOwJVK+eG9Sl2aKdkLChvPGLyncg76gl","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":33028},"main":"./dist/index.js","type":"module","_from":"file:djodjonx-gwen-vite-plugin-0.3.5.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","development":"./src/index.ts"}},"scripts":{"dev":"vite build --watch","test":"vitest run","build":"vite build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"djodjonx","email":"djo.moutier@gmail.com"},"_resolved":"/private/var/folders/vc/41dnkkc11kqfyrhq8hmhj9400000gn/T/5a5610a68e9a89c975d94b12de8748e8/djodjonx-gwen-vite-plugin-0.3.5.tgz","_integrity":"sha512-TEcVj3Jq0BKITXAbgVXXvooonzwkYue0sHOjrnLvJ0CVrGKTv6ycm01j6CHWOp1FMbI30/H2hMcCder2do6stw==","_npmVersion":"10.9.4","description":"Vite plugin for GWEN — WASM hot-reload, asset copying, manifest injection","directories":{},"_nodeVersion":"22.21.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^7.3.1","vitest":"^4.0.18","typescript":"^5.9.3","vite-plugin-dts":"^4.5.4"},"peerDependencies":{"vite":"^7.3.1"},"_npmOperationalInternal":{"tmp":"tmp/gwen-vite-plugin_0.3.5_1773067949692_0.33280829009529844","host":"s3://npm-registry-packages-npm-production"}},"0.3.6":{"name":"@djodjonx/gwen-vite-plugin","version":"0.3.6","_id":"@djodjonx/gwen-vite-plugin@0.3.6","maintainers":[{"name":"djodjonx","email":"djo.moutier@gmail.com"}],"dist":{"shasum":"84d1c73d0e6498b4e3a3b020304d9ad021dbff01","tarball":"https://registry.npmjs.org/@djodjonx/gwen-vite-plugin/-/gwen-vite-plugin-0.3.6.tgz","fileCount":5,"integrity":"sha512-fhnT4T9DxHxJ55X5U2Zc6UeqtoxIMcGtKsUEzTicsB2rYBnpuM5HjjpOrZHPC5fPb6TKAUkjLdhB8B2BLZJUJg==","signatures":[{"sig":"MEUCIQCUUDYpLPvbsdZOlhZ3CxYR0ShcEtcWOgxKHE+ncLe9cwIgdZphEmWHn9xofTCtQ8ZLMX6GTqvR0xF/Lh6hT0A8Usk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32834},"main":"./dist/index.js","type":"module","_from":"file:djodjonx-gwen-vite-plugin-0.3.6.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"vite build --watch","test":"vitest run","build":"vite build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"djodjonx","email":"djo.moutier@gmail.com"},"_resolved":"/private/var/folders/vc/41dnkkc11kqfyrhq8hmhj9400000gn/T/a8c5a2cdbedf1420efffd40fe5518d5e/djodjonx-gwen-vite-plugin-0.3.6.tgz","_integrity":"sha512-fhnT4T9DxHxJ55X5U2Zc6UeqtoxIMcGtKsUEzTicsB2rYBnpuM5HjjpOrZHPC5fPb6TKAUkjLdhB8B2BLZJUJg==","_npmVersion":"10.9.4","description":"Vite plugin for GWEN — WASM hot-reload, asset copying, manifest injection","directories":{},"_nodeVersion":"22.21.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^7.3.1","vitest":"^4.0.18","typescript":"^5.9.3","vite-plugin-dts":"^4.5.4"},"peerDependencies":{"vite":"^7.3.1"},"_npmOperationalInternal":{"tmp":"tmp/gwen-vite-plugin_0.3.6_1773070021848_0.568810070281484","host":"s3://npm-registry-packages-npm-production"}},"0.3.7":{"name":"@djodjonx/gwen-vite-plugin","version":"0.3.7","_id":"@djodjonx/gwen-vite-plugin@0.3.7","maintainers":[{"name":"djodjonx","email":"djo.moutier@gmail.com"}],"dist":{"shasum":"5c48ddaf2ebf422dc918f8c2432eddc3ba168281","tarball":"https://registry.npmjs.org/@djodjonx/gwen-vite-plugin/-/gwen-vite-plugin-0.3.7.tgz","fileCount":5,"integrity":"sha512-o+pWTaJ9BE5/XpLvQ8DWxQetKb/zUxM0uBbXe7H27xSigkjBHsg8mIrPKwX/wID4USrdLHM6gQ4+xhBnJixUrw==","signatures":[{"sig":"MEQCIFaARav1XK98NtMG/m8ovtlbK+ynqW11taNXi9gMJCnUAiAxA4/4exCykisNtgUCDpeN79RGJgIW29rTNjyYzwGKMA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32834},"main":"./dist/index.js","type":"module","_from":"file:djodjonx-gwen-vite-plugin-0.3.7.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"vite build --watch","test":"vitest run","build":"vite build","typecheck":"tsc --noEmit"},"_npmUser":{"name":"djodjonx","email":"djo.moutier@gmail.com"},"_resolved":"/private/var/folders/vc/41dnkkc11kqfyrhq8hmhj9400000gn/T/58ba8c609e36eca97d81e1eddd03414e/djodjonx-gwen-vite-plugin-0.3.7.tgz","_integrity":"sha512-o+pWTaJ9BE5/XpLvQ8DWxQetKb/zUxM0uBbXe7H27xSigkjBHsg8mIrPKwX/wID4USrdLHM6gQ4+xhBnJixUrw==","_npmVersion":"10.9.4","description":"Vite plugin for GWEN — WASM hot-reload, asset copying, manifest injection","directories":{},"_nodeVersion":"22.21.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^7.3.1","vitest":"^4.0.18","typescript":"^5.9.3","vite-plugin-dts":"^4.5.4"},"peerDependencies":{"vite":"^7.3.1"},"_npmOperationalInternal":{"tmp":"tmp/gwen-vite-plugin_0.3.7_1773311972145_0.42701505074445834","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@djodjonx/gwen-vite-plugin","version":"1.0.0","description":"Vite plugin for GWEN — WASM hot-reload, asset copying, manifest injection","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"devDependencies":{"typescript":"^5.9.3","vite":"^7.3.1","vite-plugin-dts":"^4.5.4","vitest":"^4.0.18"},"peerDependencies":{"vite":"^7.3.1"},"scripts":{"build":"vite build","dev":"vite build --watch","test":"vitest run","typecheck":"tsc --noEmit"},"_id":"@djodjonx/gwen-vite-plugin@1.0.0","_integrity":"sha512-mOWOaSGd7FE429UXunfdFsSOvQym+6AUIe4YfKuxJ/3hPqzsxmuVN8I8nrLgCeYYg9tnCKwEhExf35umfsF8Og==","_resolved":"/private/var/folders/vc/41dnkkc11kqfyrhq8hmhj9400000gn/T/b10abaa5fc7c8261e8924b0d83b71ea7/djodjonx-gwen-vite-plugin-1.0.0.tgz","_from":"file:djodjonx-gwen-vite-plugin-1.0.0.tgz","_nodeVersion":"22.21.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-mOWOaSGd7FE429UXunfdFsSOvQym+6AUIe4YfKuxJ/3hPqzsxmuVN8I8nrLgCeYYg9tnCKwEhExf35umfsF8Og==","shasum":"7778a6f21a22d8cfaddf4f66a112a1da0799dc5e","tarball":"https://registry.npmjs.org/@djodjonx/gwen-vite-plugin/-/gwen-vite-plugin-1.0.0.tgz","fileCount":5,"unpackedSize":32834,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDfUcgiKo74Pr+QZBT6Zmkwq7/OAhUrgOY0ddtJe2zmowIgWftCCjl12mYzK52w0MuGxoD8l6ZdfW9KI6N+MunLytA="}]},"_npmUser":{"name":"djodjonx","email":"djo.moutier@gmail.com"},"directories":{},"maintainers":[{"name":"djodjonx","email":"djo.moutier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/gwen-vite-plugin_1.0.0_1773671197489_0.5958351652839169"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-09T09:56:25.686Z","modified":"2026-03-16T14:26:37.799Z","0.1.0":"2026-03-09T09:56:26.007Z","0.1.1":"2026-03-09T10:42:41.415Z","0.3.5":"2026-03-09T14:52:29.843Z","0.3.6":"2026-03-09T15:27:02.022Z","0.3.7":"2026-03-12T10:39:32.338Z","1.0.0":"2026-03-16T14:26:37.670Z"},"description":"Vite plugin for GWEN — WASM hot-reload, asset copying, manifest injection","maintainers":[{"name":"djodjonx","email":"djo.moutier@gmail.com"}],"readme":"#@djodjonx/gwen-vite-plugin\n\n**GWEN Vite Plugin — WASM hot-reload, asset management, and scene auto-discovery**\n\nIntegrate GWEN with Vite for seamless development with WASM hot-reloading.\n\n## Installation\n\n```bash\nnpm install -D@djodjonx/gwen-vite-plugin\n```\n\n## Quick Start\n\n### Add to vite.config.ts\n\n```typescript\nimport { defineConfig } from 'vite';\nimport { gwen } from '@djodjonx/gwen-vite-plugin';\n\nexport default defineConfig({\n  plugins: [\n    gwen({\n      cratePath: './crates/gwen-core',\n      watch: true,\n    }),\n  ],\n});\n```\n\n### Add to TypeScript Config\n\n```typescript\n// vite.config.ts\nimport { defineConfig } from 'vite';\nimport { gwen } from '@djodjonx/gwen-vite-plugin';\n\nexport default defineConfig({\n  plugins: [gwen()],\n});\n```\n\n## Features\n\n### 1. **WASM Hot-Reload**\n\nAutomatically rebuilds Rust/WASM code when `.rs` files change, then triggers HMR.\n\n```typescript\nnew GwenPlugin({\n  cratePath: '../crates/gwen-core',\n  watch: true,\n  wasmMode: 'debug', // 'debug' for dev, 'release' for build\n});\n```\n\n### 2. **Scene Auto-Discovery**\n\nScans `src/scenes/` and generates scene registry automatically.\n\n```typescript\n// Scenes are auto-discovered from src/scenes/*.ts\n// Example: src/scenes/GameScene.ts → auto-registered\n```\n\n### 3. **Manifest Injection**\n\nInjects `gwen-manifest.json` as a virtual module.\n\n```typescript\nimport manifest from 'virtual:gwen-manifest';\n\nconsole.log(manifest.version);\nconsole.log(manifest.buildDate);\n```\n\n## Configuration\n\n```typescript\ninterface GwenPluginOptions {\n  // Path to Rust crate (containing Cargo.toml)\n  cratePath?: string;\n\n  // URL prefix for served WASM files (default: '/wasm')\n  wasmPublicPath?: string;\n\n  // Enable WASM file watching (default: true in dev, false in build)\n  watch?: boolean;\n\n  // Compilation mode: 'debug' (fast) or 'release' (optimized)\n  wasmMode?: 'release' | 'debug';\n\n  // Path to gwen-manifest.json (optional)\n  manifestPath?: string;\n\n  // Enable verbose logging\n  verbose?: boolean;\n}\n```\n\n## Examples\n\n### Development Setup\n\n```typescript\n// vite.config.ts\nimport { defineConfig } from 'vite';\nimport { gwen } from '@djodjonx/gwen-vite-plugin';\n\nexport default defineConfig({\n  plugins: [\n    gwen({\n      cratePath: './crates/gwen-core',\n      watch: process.env.NODE_ENV === 'development',\n      wasmMode: 'debug',\n      verbose: true,\n    }),\n  ],\n});\n```\n\n### Production Optimized Build\n\n```typescript\n// vite.config.ts\nexport default defineConfig({\n  plugins: [\n    gwen({\n      cratePath: './crates/gwen-core',\n      wasmMode: 'release', // Optimized binary\n      watch: false,\n    }),\n  ],\n});\n```\n\n### With Scene Auto-Discovery\n\n```typescript\n// src/scenes/GameScene.ts\nimport { defineScene } from '@djodjonx/gwen-engine-core';\n\nexport const GameScene = defineScene({\n  name: 'game',\n  onInit(api) {\n    console.log('Game started!');\n  },\n  onUpdate(delta) {\n    // Game logic\n  },\n});\n\n// src/scenes/MenuScene.ts\nexport const MenuScene = defineScene({\n  name: 'menu',\n  onInit(api) {\n    console.log('Menu opened!');\n  },\n});\n\n// Scenes are auto-discovered and registered ✨\n```\n\n## Virtual Modules\n\n### `virtual:gwen-manifest`\n\nAccess build metadata:\n\n```typescript\nimport manifest from 'virtual:gwen-manifest';\n\nconsole.log(manifest.version); // Package version\nconsole.log(manifest.buildDate); // Build timestamp\nconsole.log(manifest.wasmPath); // Path to WASM binary\n```\n\n## Troubleshooting\n\n### WASM Files Not Updating\n\n- Ensure `watch: true` is set in dev mode\n- Check that `cratePath` points to the correct Cargo.toml\n- Verify WASM builds succeed with `cargo build --target wasm32-unknown-unknown`\n\n### Scene Discovery Not Working\n\n- Place scenes in `src/scenes/` directory\n- Use `defineScene()` or export as class\n- Check browser console for auto-discovery logs with `verbose: true`\n\n## Performance Tips\n\n- Use `wasmMode: 'debug'` during development (faster rebuilds)\n- Use `wasmMode: 'release'` for production builds\n- Enable `watch: false` in production configuration\n\n## See Also\n\n- [@djodjonx/gwen-engine-core](../engine-core/) — Core engine\n- [@djodjonx/gwen-cli](../cli/) — Command-line interface\n- [Vite Documentation](https://vitejs.dev)\n","readmeFilename":"README.md"}