API Reference
Nuxt Module Options
Configure the Nuxt wrapper through the supported public module surface.
@onmax/nuxt-phaser exposes one module key: phaser.
nuxt.config.ts
export default defineNuxtConfig({
modules: ['@onmax/nuxt-phaser'],
phaser: {
autoImports: true,
components: true,
componentPrefix: 'Phaser',
clientOnly: true,
debug: false,
devtools: false,
defaults: {
pixelArt: false,
transparent: false,
suspendWhenHidden: true,
assetsBaseUrl: '/',
},
},
})
Options
| Option | Type | Default | Meaning |
|---|---|---|---|
autoImports | boolean | true | Auto-import shared composables and helpers. |
components | boolean | true | Globally register the wrapped component set. |
componentPrefix | string | 'Phaser' | Prefix for registered component names. |
clientOnly | boolean | true | Wrap NuxtPhaserGame in ClientOnly. |
debug | boolean | false | Enable the debug warning path by default. |
devtools | boolean | false | Reserved for future Nuxt devtools integration. |
defaults.pixelArt | boolean | false | Default host pixel-art mode. |
defaults.transparent | boolean | false | Default transparent canvas mode. |
defaults.suspendWhenHidden | boolean | true | Pause rendering when the document is hidden. |
defaults.assetsBaseUrl | string | '/' | Default base URL for usePhaserAssetUrl. |
The module does not add a separate runtime abstraction beyond those options. Shared host props and scene code still define the real game behavior.