Registry / web-framework / vite-plugin-with-nitro

vite-plugin-with-nitro

JSON →
library0.0.5jsnpmunverified

A Vite plugin that adds a Nitro API server to your Vite project, forked from @analogjs/vite-plugin-nitro. Current version 0.0.5 is experimental. Use it to develop and build an API server with Nitro (UnJS) alongside your Vite frontend. Differs from the analogjs fork by being standalone without AnalogJS dependencies. Requires Node >=20 and Vite 5. Release cadence is low; the package is in early stages.

npm install vite-plugin-with-nitro
INSTALL
IMPORT
SIG · VITE-PLUGIN-WITH-N
V
vite-plugin-with-nitro
web-frameworkjavascriptv0.0.5
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

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

default
import nitro from 'vite-plugin-with-nitro'
const nitro = require('vite-plugin-with-nitro')
This package is ESM-only, CommonJS require will fail.
VitePluginWithNitro
import { VitePluginWithNitro } from 'vite-plugin-with-nitro'
Not a typical import; the default export is the recommended way.
NitroOptions
import type { NitroOptions } from 'vite-plugin-with-nitro'
import { NitroOptions } from 'vite-plugin-with-nitro'
NitroOptions is a TypeScript type, should be imported with `import type` to avoid runtime errors.

Basic setup: add the nitro plugin to Vite config with optional Nitro preset and API directory.

// vite.config.ts import { defineConfig } from 'vite' import nitro from 'vite-plugin-with-nitro' export default defineConfig({ plugins: [ nitro({ // Nitro options preset: 'node-server', // Optional: customize API directory apiDir: '.nitro/api', }), ], })
Debug
Known issues
breakingForced Node.js version requirement >=20.0.0
fix
Upgrade Node.js to version 20 or higher.
affects: >=0.0.0
gotchaThe plugin is ESM-only; using require() will fail with a runtime error.
fix
Use import syntax or configure your project to use ESM.
affects: >=0.0.0
gotchaForked from @analogjs/vite-plugin-nitro; API may differ from the original.
fix
Check the documentation for any changes if migrating from the analogjs fork.
affects: >=0.0.0
deprecatedPackage is at version 0.0.5 — very early stage, breaking changes may occur.
fix
Pin to exact version or expect breaking changes on minor/patch updates.
affects: <1.0.0
Errors
Common errors & fixes
Cannot find module 'vite-plugin-with-nitro'
Package not installed or not in node_modules.
fix
Run `pnpm add vite-plugin-with-nitro -S`
Error: The plugin 'vite-plugin-with-nitro' requires Node.js >=20.0.0
Node.js version is too low.
fix
Upgrade Node.js to version 20 or higher.
SyntaxError: Cannot use import statement outside a module
The project is not configured as ESM and you are using import syntax.
fix
Add "type": "module" to package.json or rename file to .mjs.
Upgrade
Version history
0.0.5latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
vite-plugin-with-nitro — npm install vite-plugin-with-nitro · libregistry