A webpack plugin that automatically compiles .proto files with gRPC-Web and protoc during build. Version 0.2.79 is the latest stable release, with recent updates focused on bug fixes. It supports multiple output types (JavaScript, gRPC-Web client stubs), import styles (closure, commonjs, commonjs+dts, typescript), and wire format modes (grpcwebtext, grpcweb). Key differentiators: build-time proto compilation eliminates manual protoc invocations; file watching for .proto changes; synchronization with source .proto files. Requires node >=10.12.0 and peer dependencies grpc-web ^1.0.0 and webpack ^4.0.0.
npm install grpc-webpack-pluginNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures webpack to compile .proto files during build: first generates pure JS message classes, then generates gRPC-Web client stubs with TypeScript definitions.
Install protoc from https://github.com/protocolbuffers/protobuf/releases and protoc-gen-grpc-web from https://github.com/grpc/grpc-web/releases, ensuring they are in PATH.
Upgrade to >=0.2.78 and update configuration to use 'mode' property instead of previous deprecated behavior.
If using webpack 5, consider alternative plugins or test compatibility; maintain webpack 4 if using this plugin.
Set synchronize: true and webpack watch: true (or use webpack-dev-server with watch enabled).
Evaluate alternatives if file watching or webpack 5 support is critical.
Run 'npm install --save-dev grpc-webpack-plugin' or 'yarn add --dev grpc-webpack-plugin'.
Install protoc from https://github.com/protocolbuffers/protobuf/releases and ensure it is in your system PATH.
Download and install protoc-gen-grpc-web from https://github.com/grpc/grpc-web/releases, then add its location to PATH.
Use 'const GrpcWebPlugin = require("grpc-webpack-plugin");' (CommonJS) or use esModuleInterop in TypeScript.