Reference

Module options

Every key of pglite in nuxt.config.ts, with its type and default.

The pglite key of nuxt.config.ts takes any part of this shape, merged over the defaults. The type is exported as ModuleOptions from nuxt-pglite; ResolvedModuleOptions is the same with every default filled in.

defaults
export default defineNuxtConfig({
  pglite: {
    server: {
      enabled: true,
      config: 'server/pglite.config',
      options: {},
      eager: false,
    },
    client: {
      enabled: false,
      config: 'app/pglite.config',
      options: {},
      eager: false,
    },
    socket: false,
    devtools: true,
  },
})

server

KeyTypeDefault
enabledbooleantrueRegisters usePGlite() and the server instance. false keeps PGlite out of the server bundle.
configstring'server/pglite.config'Config file path, relative to the root directory, extension optional.
optionsSerializablePGliteOptions{}Build-time PGlite options the config file can override. A relative dataDir is resolved from the root directory; .data/pglite when unset.
eagerbooleanfalseCreates the instance when the server starts instead of on first use.

SerializablePGliteOptions is PGlite's PGliteOptions without extensions, fs, loadDataDir, parsers and serializers, which cannot be serialized into the build.

client

KeyTypeDefault
enabledbooleanfalseRegisters the in-browser instance, usePGlite() and the live-query composables. Requires the Vite builder.
configstring'app/pglite.config'Config file path, relative to the root directory, extension optional.
optionsSerializablePGliteWorkerOptions{}Build-time PGlite worker options the config file can override.
eagerbooleanfalseStarts the worker when the app loads instead of on first use.

socket

boolean | SocketOptions, default false. Serves the server config's instance over the Postgres wire protocol in nuxt dev, so drivers and tools outside the app reach it through a URL. Development only, and independent of server.enabled. true takes every default; the object's keys, devtoolsActions included, are in Socket options.

devtools

boolean, default true. Adds the PGlite tab to Nuxt DevTools, when DevTools itself is enabled (Nuxt's own devtools key). Nothing of it is registered outside nuxt dev. Actions are not configured here: they live in the config files and in socket.devtoolsActions.