Early development: IFLoom can change until 1.0. What's stable
IFLoom

@ifloom/cli/vite

Every export of @ifloom/cli/vite, the Vite preset: its signature and its fields.

Generated from the source of @ifloom/cli/vite and its TSDoc by npm run api-docs. Each export links to the page that explains it, where one does.

ifloom

Function.

Returns the Vite config every IFLoom game builds with, which writes one HTML file with relative paths. It names no UI framework, so a game adds its framework's Vite plugin in vite.plugins.

The preset's plugins come after the game's. Inside the IFLoom checkout it reads the @ifloom packages' source, and it encrypts a game's src/unlocks/ packs into the page.

function ifloom(options?: IfloomViteOptions): UserConfig

Uses: IfloomViteOptions.

IfloomViteOptions

Type. Explained in The CLI.

Settings for ifloom(), the Vite preset. Each is optional.

type IfloomViteOptions = {
  singleFile?: boolean
  vite?: UserConfig | undefined
}
FieldTypeOptionalDefaultDescription
singleFilebooleanyesTrue to put the JS and CSS inside the one HTML file, rather than beside it. True if left out.
viteUserConfig | undefinedyesThe game's own Vite config, which the preset builds on. The preset keeps base at './' and adds its plugins after the game's plugins, where the game's framework plugin goes.

Last updated on

On this page