Skip to content

Commit

Permalink
Merge pull request #143 from dibenede/disable-optimizations
Browse files Browse the repository at this point in the history
Return to using default closure optimization level
  • Loading branch information
dibenede authored Oct 10, 2022
2 parents 3b3a8ab + 0466dbc commit 64c19f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
14 changes: 5 additions & 9 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,9 @@ function genproto_group3_commonjs_strict(cb) {
}


function getClosureCompilerCommand(exportsFile, outputFile, keepSymbols) {
let compilationLevel = 'ADVANCED';
if (keepSymbols === true) {
compilationLevel = 'SIMPLE';
}

function getClosureCompilerCommand(exportsFile, outputFile) {
// Use the default optimization level: SIMPLE_OPTIMIZATIONS:
// https://developers.google.com/closure/compiler/docs/compilation_levels#simple_optimizations
const closureLib = 'node_modules/google-closure-library';
return [
'node_modules/.bin/google-closure-compiler',
Expand All @@ -139,13 +136,13 @@ function getClosureCompilerCommand(exportsFile, outputFile, keepSymbols) {
'--js=binary/utils.js',
'--js=binary/writer.js',
`--js=${exportsFile}`,
`--compilation_level="${compilationLevel}"`,
'--generate_exports',
'--export_local_property_definitions',
`--entry_point=${exportsFile}`, `> ${outputFile}`
].join(' ');
}


function gen_google_protobuf_js(cb) {
exec(
getClosureCompilerCommand('commonjs/export.js', 'google-protobuf.js'),
Expand All @@ -157,8 +154,7 @@ function commonjs_testdeps(cb) {
'mkdir -p commonjs_out/test_node_modules && ' +
getClosureCompilerCommand(
'commonjs/export_testdeps.js',
'commonjs_out/test_node_modules/testdeps_commonjs.js',
true),
'commonjs_out/test_node_modules/testdeps_commonjs.js'),
make_exec_logging_callback(cb));
}

Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 64c19f8

Please sign in to comment.