Registry / observability / rollup-plugin-pino-bundle

rollup-plugin-pino-bundle

JSON →
library1.0.2jsnpmunverified

A Rollup and Vite plugin that bundles Pino logger and its transports (e.g., pino-pretty, pino-loki) into the application output. Current stable version is 1.0.2. This plugin addresses the unique challenges of bundling Pino's worker threads and file transports, ensuring they function correctly in bundled applications. It integrates seamlessly with both Rollup and Vite, supporting custom directories for pino files and transports. The plugin includes caching for improved build performance and ships with TypeScript type definitions. It is actively maintained on GitHub.

npm install rollup-plugin-pino-bundle
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-PINO
R
rollup-plugin-pino-bundle
observabilityjavascriptv1.0.2
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 pinoBundle from 'rollup-plugin-pino-bundle'
const pinoBundle = require('rollup-plugin-pino-bundle')
Package exports a default export. ESM import is recommended.
type PinoBundleOptions
import type { PinoBundleOptions } from 'rollup-plugin-pino-bundle'
import { PinoBundleOptions } from 'rollup-plugin-pino-bundle'
PinoBundleOptions is a TypeScript type, must be imported with 'import type'.
named export (none)
import pinoBundle from 'rollup-plugin-pino-bundle'
import { pinoBundle } from 'rollup-plugin-pino-bundle'
Only default export is available.

Shows how to configure pinoBundle with Vite, including a transport (pino-pretty).

import { defineConfig } from 'vite'; import pinoBundle from 'rollup-plugin-pino-bundle'; export default defineConfig({ plugins: [ pinoBundle({ transports: ['pino-pretty'], }), ], });
Debug
Known issues
gotchaTransports not working in production build if not listed in options
fix
Add all required transport module names to the 'transports' array in the plugin configuration.
affects: >=1.0.0
gotchaLimited Vite dev server support: hot reload may not work correctly
fix
For development, consider using Pino's default configuration without the plugin, or test in production builds.
affects: >=1.0.0
gotchaThe plugin modifies the output directory structure, creating a 'pino' folder
fix
Ensure your output directory is clean and that you don't have conflicting files with the same names.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'pino-pretty'
Transport module not specified in the 'transports' option.
fix
Add 'pino-pretty' to the transports array: { transports: ['pino-pretty'] }
TypeError: pinoBundle is not a function
Using named import instead of default import, or CommonJS require incorrectly.
fix
Use default import: import pinoBundle from 'rollup-plugin-pino-bundle'
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
25 hits · last 30 days
node
18
OpenAI (training)
2
Amazon
1
Resources
rollup-plugin-pino-bundle — npm install rollup-plugin-pino-bundle · libregistry