Module options
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.
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
| Key | Type | Default | |
|---|---|---|---|
enabled | boolean | true | Registers usePGlite() and the server instance. false keeps PGlite out of the server bundle. |
config | string | 'server/pglite.config' | Config file path, relative to the root directory, extension optional. |
options | SerializablePGliteOptions | {} | Build-time PGlite options the config file can override. A relative dataDir is resolved from the root directory; .data/pglite when unset. |
eager | boolean | false | Creates 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
| Key | Type | Default | |
|---|---|---|---|
enabled | boolean | false | Registers the in-browser instance, usePGlite() and the live-query composables. Requires the Vite builder. |
config | string | 'app/pglite.config' | Config file path, relative to the root directory, extension optional. |
options | SerializablePGliteWorkerOptions | {} | Build-time PGlite worker options the config file can override. |
eager | boolean | false | Starts 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.