|
|
@ -652,15 +652,9 @@ function cleanupCSSSource(file) { |
|
|
|
//
|
|
|
|
//
|
|
|
|
// make minified
|
|
|
|
// make minified
|
|
|
|
// Builds the minified production viewer that should be compatible with most
|
|
|
|
// Builds the minified production viewer that should be compatible with most
|
|
|
|
// modern HTML5 browsers. Requires Google Closure Compiler.
|
|
|
|
// modern HTML5 browsers.
|
|
|
|
//
|
|
|
|
//
|
|
|
|
target.minified = function() { |
|
|
|
target.minified = function() { |
|
|
|
var compilerPath = process.env['CLOSURE_COMPILER']; |
|
|
|
|
|
|
|
if (!compilerPath) { |
|
|
|
|
|
|
|
echo('### Closure Compiler is not set. Specify CLOSURE_COMPILER variable'); |
|
|
|
|
|
|
|
exit(1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
target.bundle({}); |
|
|
|
target.bundle({}); |
|
|
|
target.locale(); |
|
|
|
target.locale(); |
|
|
|
|
|
|
|
|
|
|
@ -703,22 +697,20 @@ target.minified = function() { |
|
|
|
MINIFIED_DIR + BUILD_DIR + 'pdf.js', |
|
|
|
MINIFIED_DIR + BUILD_DIR + 'pdf.js', |
|
|
|
MINIFIED_DIR + '/web/viewer.js' |
|
|
|
MINIFIED_DIR + '/web/viewer.js' |
|
|
|
]; |
|
|
|
]; |
|
|
|
var cmdPrefix = 'java -jar \"' + compilerPath + '\" ' + |
|
|
|
|
|
|
|
'--language_in ECMASCRIPT5 ' + |
|
|
|
|
|
|
|
'--warning_level QUIET ' + |
|
|
|
|
|
|
|
'--compilation_level SIMPLE_OPTIMIZATIONS '; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo(); |
|
|
|
echo(); |
|
|
|
echo('### Minifying js files'); |
|
|
|
echo('### Minifying js files'); |
|
|
|
|
|
|
|
|
|
|
|
exec(cmdPrefix + viewerFiles.map(function(s) { |
|
|
|
var UglifyJS = require('uglify-js'); |
|
|
|
return '--js \"' + s + '\"'; |
|
|
|
// V8 chokes on very long sequences. Works around that.
|
|
|
|
}).join(' ') + |
|
|
|
var optsForHugeFile = {compress: {sequences: false}}; |
|
|
|
' --js_output_file \"' + MINIFIED_DIR + '/web/pdf.viewer.js\"'); |
|
|
|
|
|
|
|
exec(cmdPrefix + '--js \"' + MINIFIED_DIR + '/build/pdf.js' + '\" ' + |
|
|
|
UglifyJS.minify(viewerFiles).code |
|
|
|
'--js_output_file \"' + MINIFIED_DIR + '/build/pdf.min.js' + '\"'); |
|
|
|
.to(MINIFIED_DIR + '/web/pdf.viewer.js'); |
|
|
|
exec(cmdPrefix + '--js \"' + MINIFIED_DIR + '/build/pdf.worker.js' + '\" ' + |
|
|
|
UglifyJS.minify(MINIFIED_DIR + '/build/pdf.js').code |
|
|
|
'--js_output_file \"' + MINIFIED_DIR + '/build/pdf.worker.min.js' + '\"'); |
|
|
|
.to(MINIFIED_DIR + '/build/pdf.min.js'); |
|
|
|
|
|
|
|
UglifyJS.minify(MINIFIED_DIR + '/build/pdf.worker.js', optsForHugeFile).code |
|
|
|
|
|
|
|
.to(MINIFIED_DIR + '/build/pdf.worker.min.js'); |
|
|
|
|
|
|
|
|
|
|
|
echo(); |
|
|
|
echo(); |
|
|
|
echo('### Cleaning js files'); |
|
|
|
echo('### Cleaning js files'); |
|
|
|