zephyr-nuxt-module
v1.2.1
Published
Nuxt module for deploying Nuxt applications with Zephyr Cloud
Downloads
1,549
Readme
Zephyr Nuxt Module
A Nuxt module for deploying Nuxt applications with Zephyr Cloud. It uploads the Nitro build output to Zephyr during nuxt build.
Installation
# npm
npm install --save-dev zephyr-nuxt-module
# yarn
yarn add --dev zephyr-nuxt-module
# pnpm
pnpm add --dev zephyr-nuxt-module
# bun
bun add --dev zephyr-nuxt-moduleUsage
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['zephyr-nuxt-module'],
});Options
export default defineNuxtConfig({
modules: ['zephyr-nuxt-module'],
zephyr: {
// Publish a TAP package rather than the default web artifact
target: 'tap-app',
// JSON-serializable metadata from the package SDK
mfConfigs: [
{ name: 'desktop', filename: 'targets/desktop/remoteEntry.mjs' },
{ name: 'quickjs', filename: 'targets/quickjs/remoteEntry.mjs' },
],
federation: [
{ name: 'desktop', remote: 'targets/desktop/remoteEntry.mjs' },
{ name: 'quickjs', remote: 'targets/quickjs/remoteEntry.mjs' },
],
// Override Nitro output dir (defaults to nitro.options.output.dir)
outputDir: '.output',
// Explicit SSR entrypoint (relative to outputDir)
entrypoint: 'server/index.mjs',
// Force snapshot type: 'ssr' or 'csr'
snapshotType: 'ssr',
// Optional Zephyr build hooks
// hooks: { onDeployComplete(info) { ... } }
},
});Notes
- If no entrypoint is found, the module falls back to a CSR snapshot.
- Entry points are auto-detected from
server/index.mjs,server/index.js, orserver/index.cjswhen not provided. - Upload logic is skipped during
nuxt prepare(includingpostinstallhooks). - For
target: 'tap-app',mfConfigsandfederationare required, non-empty arrays. Each unique confignameandfilenamemust match a metadata entry'snameandremote; the module fails before upload when that pairing is incomplete. It forwards this caller-provided SDK metadata unchanged. For non-TAP builds the fields remain optional. A complete singleton config also fills the legacymfConfigsnapshot field.
License
Licensed under the Apache-2.0 License. See LICENSE.
