Configuration
You can add xState field in your nuxt.config.ts to configure the module:
ts
import { defineNuxtConfig } from 'nuxt'
export default defineNuxtConfig({
modules: ['nuxt-xstate'],
// Shown below are the default module options
xState: {
minimal: false, // boolean
customMachines: {
dir: 'machines', // string
importSuffix: 'Machine', // string
}
},
})
import { defineNuxtConfig } from 'nuxt'
export default defineNuxtConfig({
modules: ['nuxt-xstate'],
// Shown below are the default module options
xState: {
minimal: false, // boolean
customMachines: {
dir: 'machines', // string
importSuffix: 'Machine', // string
}
},
})
minimal: set totrueto use minified implementations of certain XState features (see here)customMachines: set tofalseto disable auto-importing of your own state-machines. It is an object and it has two properties,dirandimportSuffixdir: the directory where your state-machines are locatedimportSuffix: the suffix you want appended to your state-machine names