Nuxt Module
Installation
Add @onmax/nuxt-phaser to nuxt.config.ts and let the module install the shared Vue runtime.
The module registers the runtime plugin, the #phaser alias, composable auto-imports, and the global components you opt into.
nuxt.config.ts
export default defineNuxtConfig({
modules: ['@onmax/nuxt-phaser'],
phaser: {
autoImports: true,
components: true,
componentPrefix: 'Phaser',
clientOnly: true,
},
})
What the module adds
#phaseralias that re-exports@onmax/phaser-vue- Auto-imports for the shared composables and scene helpers
- Global registration for
PhaserGame,PhaserScene, primitives, andNuxtPhaserGame runtimeConfig.public.phaserdefaults that the runtime plugin passes intocreatePhaserVue
What it does not add
- A second scene system
- A server-side Phaser runtime
- A different primitive contract than the Vue package
Use the module for Nuxt ergonomics. Use the Vue docs to understand the shared runtime behavior under those imports.