Skip {hybrid} advanced compilation for templates.

Former-commit-id: d76ed99ba7d906812b24a751b56d3a8a6b955203
This commit is contained in:
Kit Cambridge
2012-11-08 17:07:01 -08:00
parent 3db6841305
commit 6782bc8ca2

View File

@@ -270,7 +270,13 @@
this.compiled.simple.gzip = result;
// next, compile the source using advanced optimizations
closureCompile.call(this, this.source, 'advanced', onClosureAdvancedCompile.bind(this));
if (this.isTemplate) {
// jump directly to UglifyJS for templates.
uglify.call(this, this.source, onUglify.bind(this));
} else {
// otherwise, compress using advanced optimizations
closureCompile.call(this, this.source, 'advanced', onClosureAdvancedCompile.bind(this));
}
}
function onClosureAdvancedCompile(exception, result) {
@@ -389,7 +395,16 @@
this.hybrid.simple.gzip = result;
var message = 'Compressing ' + path.basename(this.outputPath, '.js') + ' using hybrid minification; `ADVANCED_OPTIMIZATIONS`...';
uglify.call(this, this.compiled.advanced.source, message, onAdvancedHybrid.bind(this));
if (this.isTemplate) {
this.compiled.advanced = this.hybrid.advanced = {
'gzip': {
'length': Infinity
}
};
onComplete.call(this);
} else {
uglify.call(this, this.compiled.advanced.source, message, onAdvancedHybrid.bind(this));
}
}
/**