Registry / serialization / rollup-plugin-protobuf

rollup-plugin-protobuf

JSON →
library0.1.1jsnpmunverified

A Rollup plugin that converts .proto files into JavaScript modules using protobuf.js. Version 0.1.1 (stable, no recent updates). It integrates protobuf compilation into the Rollup build pipeline, allowing direct import of .proto files. Differentiates by being Rollup-specific and supporting options like convertFieldsToCamelCase. No known alternatives for Rollup + protobuf.

npm install rollup-plugin-protobuf
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-PROT
R
rollup-plugin-protobuf
serializationjavascriptv0.1.1
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 protobuf from 'rollup-plugin-protobuf'
const protobuf = require('rollup-plugin-protobuf')
ESM only; CommonJS require may fail without .default.
plugin usage
plugins: [ protobuf({ convertFieldsToCamelCase: true }) ]
plugins: [ protobuf.default({ convertFieldsToCamelCase: true }) ]
Default export is directly callable; no .default needed.
import messages
import messages from './messages.proto'
import { messages } from './messages.proto'
Proto files export a default object; named imports won't work.

Shows how to configure the plugin with convertFieldsToCamelCase option and import a .proto file.

import { rollup } from 'rollup'; import protobuf from 'rollup-plugin-protobuf'; async function build() { const bundle = await rollup({ input: 'src/main.js', plugins: [ protobuf({ convertFieldsToCamelCase: true }) ] }); await bundle.write({ file: 'dist/bundle.js', format: 'esm' }); } build();
Debug
Known issues
gotchaProto file imports only export a default object; named imports will be undefined.
fix
Use default import: import messages from './messages.proto'
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'rollup-plugin-protobuf'
Package not installed or missing from node_modules.
fix
Run: npm install --save-dev rollup-plugin-protobuf
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
rollup-plugin-protobuf — npm install rollup-plugin-protobuf · libregistry