Installation
Add @lupinum/nuxt-email to a supported Nuxt application and optionally configure syntax highlighting.
Nuxt Email installs into an existing, supported Nuxt 4 application. Its email discovery and rendering conventions require no configuration.
1. Add the Nuxt module
npx nuxt module add @lupinum/nuxt-emailThis installs the package and adds the scoped module name to nuxt.config.ts.
nuxt-email package on npm is unrelated to this project. Always install and import @lupinum/nuxt-email.For a manual installation, install the package and use the same string registration:
pnpm add @lupinum/nuxt-emailexport default defineNuxtConfig({
modules: ['@lupinum/nuxt-email'],
})2. Confirm the TypeScript entry point
If your app does not already have one, add the ordinary Nuxt tsconfig.json:
{
"extends": "./.nuxt/tsconfig.json"
}Optional code blocks
Syntax highlighting is opt-in. Configure exactly the languages your templates use and one Shiki theme:
export default defineNuxtConfig({
modules: ['@lupinum/nuxt-email'],
nuxtEmail: {
codeBlock: {
languages: ['typescript'],
theme: 'github-dark',
},
},
})Without codeBlock, ECodeBlock is not registered and Shiki is not loaded during module setup or included in the production server bundle. The Shiki packages remain installation-time dependencies of @lupinum/nuxt-email; the option controls runtime/build cost, not package-manager download cost. Discovery directories, the preview route, and the render API remain fixed. See the module behavior reference for the full contract.
What the module registers
- Server-only auto-imports for eighteen built-in
E*components, plusECodeBlockwhen configured. - A Nitro-only
renderEmail(name, props)auto-import, typed fromapp/emails/. - The explicit
@lupinum/nuxt-email/define-emailentry point for declaring a subject inside a template. - A development-only preview application at
/__email(never present in production output).
Next, author your first email.