{"id":22187,"library":"rollup-plugin-protobuf","title":"rollup-plugin-protobuf","description":"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.","status":"active","version":"0.1.1","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","rollup-plugin","protobuf"],"install":[{"cmd":"npm install rollup-plugin-protobuf","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-protobuf","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-protobuf","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM only; CommonJS require may fail without .default.","wrong":"const protobuf = require('rollup-plugin-protobuf')","symbol":"default","correct":"import protobuf from 'rollup-plugin-protobuf'"},{"note":"Default export is directly callable; no .default needed.","wrong":"plugins: [ protobuf.default({ convertFieldsToCamelCase: true }) ]","symbol":"plugin usage","correct":"plugins: [ protobuf({ convertFieldsToCamelCase: true }) ]"},{"note":"Proto files export a default object; named imports won't work.","wrong":"import { messages } from './messages.proto'","symbol":"import messages","correct":"import messages from './messages.proto'"}],"quickstart":{"code":"import { rollup } from 'rollup';\nimport protobuf from 'rollup-plugin-protobuf';\n\nasync function build() {\n  const bundle = await rollup({\n    input: 'src/main.js',\n    plugins: [\n      protobuf({ convertFieldsToCamelCase: true })\n    ]\n  });\n  await bundle.write({ file: 'dist/bundle.js', format: 'esm' });\n}\n\nbuild();","lang":"javascript","description":"Shows how to configure the plugin with convertFieldsToCamelCase option and import a .proto file."},"warnings":[{"fix":"Use default import: import messages from './messages.proto'","message":"Proto file imports only export a default object; named imports will be undefined.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run: npm install --save-dev rollup-plugin-protobuf","cause":"Package not installed or missing from node_modules.","error":"Error: Cannot find module 'rollup-plugin-protobuf'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}