Skip to content

zhangshaolong/protobuf-json-webpack-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

protobuf-json-webpack-plugin

protobuf compile to json file

install

  npm install protobuf-json-webpack-plugin --save-dev

webpack config

const Proto2JsonPlugin = require('protobuf-json-webpack-plugin')


plugins: [
  new Proto2JsonPlugin(
    inputs: ['/a/b/c.proto', '/a/c/*.proto'],
    output: '/a/b/c/xxxx.js'
  )
]

js call

const struct = require('${output js file path}')
const yyyy = struct.lookupType('xxx.Yyyy')
const jsData = yyyy.decode(data)

About

protobuf compile to json file

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published