
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
webpack-grpc-web-loader
Advanced tools
A webpack loader to load .proto files for grpc-web with effortless setup.
👉 You don't have to install protoc or protoc-gen-grpc-web plugin in your environment, just use npm or yarn to install this webpack loader, and everything is done.
npm install --save-dev webpack-grpc-web-loader
Or
yarn add --dev webpack-grpc-web-loader
const path = require('path');
module.exports = {
module: {
rules: [
{
test: /\.proto$/,
use: [
{
loader: 'webpack-grpc-web-loader',
options: {
protoPath: path.resolve(__dirname, './src/protos'),
},
},
],
},
],
},
};
If you have multiple proto paths, you can pass an array to the option protoPath
:
{
loader: 'webpack-grpc-web-loader',
options: {
protoPath: [
path.resolve(__dirname, './src/my-protos-1'),
path.resolve(__dirname, './src/my-protos-2'),
],
},
}
import helloWorldProto from './hello-world.proto';
const client = new helloWorldProto.HelloWorldClient('http://localhost:11101/grpc');
const helloRequest = new helloWorldProto.HelloRequest();
client.helloWorld(helloRequest, {}, (err, res) => {
// handle error and response here
});
Option Name | Type | Required | Default Value | Description |
---|---|---|---|---|
protoPath | string | string[] | true | N/A | Same as --proto_path (-I ) in protoc |
FAQs
A webpack loader to load .proto files for grpc-web with effortless setup.
The npm package webpack-grpc-web-loader receives a total of 38 weekly downloads. As such, webpack-grpc-web-loader popularity was classified as not popular.
We found that webpack-grpc-web-loader demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.