proto-pbjs-loader
Webpack loader that parses .proto
files and converts them to a protobuf.js modules. It build on top of protobuf.js CLI and could be handy integrate into your current build flow.
Install
npm install --save-dev proto-pbjs-loader
Usage
module.exports = {
...
module: {
rules: [{
test: /\.proto$/,
use: {
loader: 'proto-pbjs-loader',
options: {
json: false,
paths: ['/path/to/definitions'],
pbjsArgs: ['--no-encode'],
additionalTargets: ['/path/to/additional/definitions']
}
}
}]
}
};
const Root = require('my/protobuf.proto');
Development
npm run lint
npm run test
Fresh up and fully refactored version of protobufjs-loader. Compatable with webpack 3 and 4.
Active maintenance with care and ❤️.
Feel free to send a PR.