Add a JPEG optimizer

This commit is contained in:
Gaël Métais
2015-05-31 18:39:52 +02:00
parent d7ddae38e5
commit 74eabd700c
11 changed files with 274 additions and 30 deletions
+13 -5
View File
@@ -3,7 +3,7 @@ var debug = require('debug')('ylt:runner');
var phantomasWrapper = require('./tools/phantomas/phantomasWrapper');
var jsExecutionTransformer = require('./tools/jsExecutionTransformer');
var weightChecker = require('./tools/weightChecker');
var weightChecker = require('./tools/weightChecker/weightChecker');
var rulesChecker = require('./rulesChecker');
var scoreCalculator = require('./scoreCalculator');
@@ -20,7 +20,9 @@ var Runner = function(params) {
};
// Execute Phantomas first
phantomasWrapper.execute(data).then(function(phantomasResults) {
phantomasWrapper.execute(data)
.then(function(phantomasResults) {
data.toolsResults.phantomas = phantomasResults;
// Treat the JS Execution Tree from offenders
@@ -29,7 +31,9 @@ var Runner = function(params) {
// Redownload every file
return weightChecker.recheckAllFiles(data);
}).then(function(data) {
})
.then(function(data) {
// Rules checker
var policies = require('./metadata/policies');
@@ -50,12 +54,16 @@ var Runner = function(params) {
return data;
}).then(function(data) {
})
.then(function(data) {
// Finished!
deferred.resolve(data);
}).fail(function(err) {
})
.fail(function(err) {
debug('Run failed');
debug(err);