Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minify compiled proto files (#17) #18

Merged
merged 2 commits into from
Jun 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 25 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,28 @@ clean:
rm -rf $(OUT_DIR)/*
mkdir -p $(OUT_DIR)

.PHONY: protos enums
minify:
echo "compressing protobufjs definitions";
uglifyjs src/protos/compiled-resources.js -o src/protos/compiled-resources.js --compress

for file in $(OUT_DIR)/google/ads/googleads/$(ADS_VERSION)/**/*.js; do \
echo "compressing $$(basename $$file)"; \
uglifyjs $$file -o $$file --compress; \
done; \

for file in $(OUT_DIR)/google/**/*.js; do \
echo "compressing $$(basename $$file)"; \
uglifyjs $$file -o $$file --compress; \
done; \

for file in $(OUT_DIR)/google/api/experimental/*.js; do \
echo "compressing $$(basename $$file)"; \
uglifyjs $$file -o $$file --compress; \
done; \

echo "removing empty files";
find src/protos/ -size 0 -delete

echo "finished compressing protos";

.PHONY: protos enums minify
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"@types/protobufjs": "^6.0.0",
"cosmiconfig": "^5.2.0",
"google-auth-library": "^3.1.0",
"google-protobuf": "^3.7.0-rc.2",
"grpc": "^1.18.0",
"google-protobuf": "^3.8.0",
"grpc": "^1.21.1",
"lodash.camelcase": "^4.3.0",
"lodash.get": "^4.4.2",
"lodash.set": "^4.3.2",
Expand All @@ -62,7 +62,8 @@
"tslint": "^5.11.0",
"tslint-config-prettier": "^1.17.0",
"tslint-immutable": "^5.0.0",
"typescript": "^3.1.6"
"typescript": "^3.1.6",
"uglify-js": "^3.6.0"
},
"config": {
"commitizen": {
Expand Down
Loading