JSPM

proto-loader

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 453
  • Score
    100M100P100Q94895F
  • License MIT

Protocol Buffer loader module for webpack

Package Exports

  • proto-loader

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (proto-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Protocol Buffer loader module for webpack

Converts .proto files into JSON so they can be loaded without a parser. For use with webpack and ProtoBuf.js

Installation

npm install proto-loader

Usage

Documentation: Using loaders

var protoDefinition = require('proto!./message.proto');
// => returns object converted from message.proto, resolves imports

webpack config

module.exports = {
  module: {
    loaders: [
      {
        test: /\.proto$/,
        loader: "proto-loader"
      }
    ]
  }
};

Then you only need to write: require("./message.proto")

License

MIT (http://www.opensource.org/licenses/mit-license.php)