filter files before minify, removed unused ctime

This commit is contained in:
barisusakli
2014-06-14 20:34:26 -04:00
parent ab80016910
commit d1b4efeaa3
2 changed files with 27 additions and 23 deletions

View File

@@ -15,6 +15,10 @@ var uglifyjs = require('uglify-js'),
Minifier.js.minify = function (scripts, minify, callback) {
var options = {};
scripts = scripts.filter(function(file) {
return fs.existsSync(file);
});
if (!minify) {
options.sourceMapURL = '/nodebb.min.js.map';
options.outSourceMap = 'nodebb.min.js.map';
@@ -32,7 +36,9 @@ Minifier.js.minify = function (scripts, minify, callback) {
} catch(err) {
process.send({
action: 'error',
error: err
error: {
message: err.message
}
});
}
};