Registry / devops / svelte-adapter-node-esbuild

svelte-adapter-node-esbuild

JSON →
library0.2.5jsnpmunverified

A SvelteKit adapter that uses esbuild to bundle your SvelteKit application for Node.js deployment, version 0.2.5. It handles server assets and native modules more gracefully than the official @sveltejs/adapter-node. Additionally supports optional Prometheus metrics via peer dependency prom-client. Released as needed; actively maintained.

npm install svelte-adapter-node-esbuild
INSTALL
IMPORT
SIG · SVELTE-ADAPTER-NOD
S
svelte-adapter-node-esbuild
devopsjavascriptv0.2.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

adapter
import adapter from 'svelte-adapter-node-esbuild'
const { default: adapter } = require('svelte-adapter-node-esbuild')
Default export is the adapter function. ESM only, no CommonJS support.
AdapterOptions
import type { AdapterOptions } from 'svelte-adapter-node-esbuild'
import { AdapterOptions } from 'svelte-adapter-node-esbuild'
AdapterOptions is a TypeScript type only, available when using TypeScript.
BuildOptions
import type { BuildOptions } from 'esbuild'
BuildOptions is re-exported from esbuild, but it's recommended to import directly from esbuild.

Configures SvelteKit to use the esbuild adapter with output directory 'build', precompression, custom esbuild options for minification and Node 18 target.

// svelte.config.js import adapter from 'svelte-adapter-node-esbuild' const config = { kit: { adapter: adapter({ out: 'build', precompress: true, envPrefix: '', esbuild: { minify: true, target: 'node18' } }) } } export default config
Debug
Known issues
gotchaPrometheus metrics require prom-client peer dependency and METRICS_PATH env var to be set
fix
Install prom-client: npm install prom-client. Set METRICS_PATH environment variable to a path like '/metrics'.
affects: >=0.1.0
deprecatedThe 'envPrefix' option is deprecated and will be removed in future versions
fix
Use environment variables directly without prefix or remove envPrefix from options.
affects: >=0.2.0
breakingIn version 0.2.0, the default output directory changed from 'build' to 'build' (no change, but verify your scripts)
fix
No action needed, but review deployment scripts to ensure they point to the correct output directory.
affects: ==0.2.0
Errors
Common errors & fixes
Error: Cannot find module 'prom-client'
prom-client peer dependency not installed but metrics path is set
fix
Install prom-client: npm install prom-client, or unset METRICS_PATH environment variable.
TypeError: adapter is not a function
Default import used incorrectly or CommonJS require used
fix
Use import adapter from 'svelte-adapter-node-esbuild' (ESM) and call adapter(options).
Error: The 'envPrefix' option is not supported
Using envPrefix in options with a version that removed it
fix
Remove envPrefix from adapter options and use environment variables without prefix.
Upgrade
Version history
0.2.5latest on npm
Audit
Dependencies
@sveltejs/kitrequiredPeer dependency for SvelteKit framework compatibility
prom-clientoptionalOptional dependency for Prometheus metrics support
Agent activity
5 hits · last 30 days
node
4
Resources