Skip to content

Commit 5d967a8

Browse files
committed
add readme
1 parent 3ac5c56 commit 5d967a8

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

generator/readme.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## 使用docker编译protoc-gen-js
2+
3+
运行容器
4+
5+
```
6+
docker run --rm -it -v /path/to/protobuf-javascript:/data --entrypoint=/bin/bash gcr.io/bazel-public/bazel:latest
7+
```
8+
9+
在容器中运行
10+
11+
```
12+
# 编译
13+
bazel build generator/protoc-gen-js
14+
15+
# 安装protoc
16+
PB_REL="https://github.com/protocolbuffers/protobuf/releases"
17+
curl -LO $PB_REL/download/v25.1/protoc-25.1-linux-x86_64.zip
18+
unzip protoc-25.1-linux-x86_64.zip -d $HOME/.local
19+
20+
# 引用编译好的文件
21+
protoc --plugin=protoc-gen-js=/data/bazel-bin/generator/protoc-gen-js --js_out=import_style=commonjs:. /path/to/proto
22+
23+
```

0 commit comments

Comments
 (0)