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

Return to using default closure optimization level #143

Merged
merged 2 commits into from
Oct 10, 2022
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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';
dibenede marked this conversation as resolved.
Show resolved Hide resolved
}

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.