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

  • #phaser alias that re-exports @onmax/phaser-vue
  • Auto-imports for the shared composables and scene helpers
  • Global registration for PhaserGame, PhaserScene, primitives, and NuxtPhaserGame
  • runtimeConfig.public.phaser defaults that the runtime plugin passes into createPhaserVue

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.
Copyright © 2026