@@ -27,7 +27,7 @@ the output files are computed by taking the `library` value or message name
2727So, for example, let's say you invoke the compiler as follows:
2828
2929```
30- protoc --proto_path=src --js_out=library=whizz/ponycopter,binary:build/gen src/foo.proto src/bar/baz.proto
30+ protoc --plugin=protoc-gen-js=/path/to/protobuf-javascript/bazel-bin/generator/protoc-gen-js -- proto_path=src --js_out=library=whizz/ponycopter,binary:build/gen src/foo.proto src/bar/baz.proto
3131```
3232
3333The compiler will read the files ` src/foo.proto ` and ` src/bar/baz.proto ` and
@@ -45,7 +45,7 @@ You should be able to import your generated types with statements like:
4545
4646``` js
4747goog .require (' proto.my.package.MyMessage' );
48- var message = proto .my .package .MyMessage ();
48+ const message = proto .my .package .MyMessage ();
4949```
5050
5151### CommonJS Imports
@@ -59,7 +59,7 @@ names of the output files are computed by taking the name of the each input
5959So, for example, let's say you invoke the compiler as follows:
6060
6161```
62- protoc --proto_path=src --js_out=import_style=commonjs,binary:build/gen src/foo.proto src/bar/baz.proto
62+ protoc --plugin=protoc-gen-js=/path/to/protobuf-javascript/bazel-bin/generator/protoc-gen-js -- proto_path=src --js_out=import_style=commonjs,binary:build/gen src/foo.proto src/bar/baz.proto
6363```
6464
6565The compiler will read the files ` src/foo.proto ` and ` src/bar/baz.proto ` and
@@ -80,8 +80,8 @@ PROTOC=/path/to/protoc PROTOC_INC=/path/to/proto/include gulp dist
8080You should be able to import your generated types with statements like:
8181
8282``` js
83- var messages = require (' ./messages_pb' );
84- var message = new messages.MyMessage ();
83+ const messages = require (' ./messages_pb' );
84+ const message = new messages.MyMessage ();
8585```
8686
8787### Compiler Options
0 commit comments