Skip to content

Commit c58937a

Browse files
committed
Return to using default closure optimization level
ADVANCED_OPTIMIZATION mode is breaking CommonJS users. As a spot fix, we'll return to using SIMPLE_OPTIMIZATION mode.
1 parent 3b3a8ab commit c58937a

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

gulpfile.js

+3-9
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,7 @@ function genproto_group3_commonjs_strict(cb) {
117117
}
118118

119119

120-
function getClosureCompilerCommand(exportsFile, outputFile, keepSymbols) {
121-
let compilationLevel = 'ADVANCED';
122-
if (keepSymbols === true) {
123-
compilationLevel = 'SIMPLE';
124-
}
125-
120+
function getClosureCompilerCommand(exportsFile, outputFile) {
126121
const closureLib = 'node_modules/google-closure-library';
127122
return [
128123
'node_modules/.bin/google-closure-compiler',
@@ -139,13 +134,13 @@ function getClosureCompilerCommand(exportsFile, outputFile, keepSymbols) {
139134
'--js=binary/utils.js',
140135
'--js=binary/writer.js',
141136
`--js=${exportsFile}`,
142-
`--compilation_level="${compilationLevel}"`,
143137
'--generate_exports',
144138
'--export_local_property_definitions',
145139
`--entry_point=${exportsFile}`, `> ${outputFile}`
146140
].join(' ');
147141
}
148142

143+
149144
function gen_google_protobuf_js(cb) {
150145
exec(
151146
getClosureCompilerCommand('commonjs/export.js', 'google-protobuf.js'),
@@ -157,8 +152,7 @@ function commonjs_testdeps(cb) {
157152
'mkdir -p commonjs_out/test_node_modules && ' +
158153
getClosureCompilerCommand(
159154
'commonjs/export_testdeps.js',
160-
'commonjs_out/test_node_modules/testdeps_commonjs.js',
161-
true),
155+
'commonjs_out/test_node_modules/testdeps_commonjs.js'),
162156
make_exec_logging_callback(cb));
163157
}
164158

package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)