@@ -27,7 +27,7 @@ the output files are computed by taking the `library` value or message name
27
27
So, for example, let's say you invoke the compiler as follows:
28
28
29
29
```
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
31
31
```
32
32
33
33
The 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:
45
45
46
46
``` js
47
47
goog .require (' proto.my.package.MyMessage' );
48
- var message = proto .my .package .MyMessage ();
48
+ const message = proto .my .package .MyMessage ();
49
49
```
50
50
51
51
### CommonJS Imports
@@ -59,7 +59,7 @@ names of the output files are computed by taking the name of the each input
59
59
So, for example, let's say you invoke the compiler as follows:
60
60
61
61
```
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
63
63
```
64
64
65
65
The 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
80
80
You should be able to import your generated types with statements like:
81
81
82
82
``` 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 ();
85
85
```
86
86
87
87
### Compiler Options
0 commit comments