v1.18.x
Julian Lam 9 years ago
parent fcb381f922
commit 4147e0cb94

@ -15,6 +15,7 @@
},
"dependencies": {
"async": "~1.5.0",
"autoprefixer": "^6.2.3",
"bcryptjs": "~2.3.0",
"body-parser": "^1.9.0",
"colors": "^1.1.0",
@ -59,6 +60,7 @@
"npm": "^2.1.4",
"passport": "^0.3.0",
"passport-local": "1.0.0",
"postcss": "^5.0.13",
"prompt": "^0.2.14",
"redis": "~2.4.2",
"request": "^2.44.0",

@ -7,6 +7,8 @@ var winston = require('winston'),
less = require('less'),
crypto = require('crypto'),
async = require('async'),
autoprefixer = require('autoprefixer'),
postcss = require('postcss'),
plugins = require('../plugins'),
emitter = require('../emitter'),
@ -185,16 +187,24 @@ module.exports = function(Meta) {
return;
}
Meta.css[destination] = lessOutput.css;
winston.verbose('[meta/css] Running PostCSS Plugins');
postcss([ autoprefixer ]).process(lessOutput.css).then(function (result) {
result.warnings().forEach(function (warn) {
winston.verbose(warn.toString());
});
// Save the compiled CSS in public/ so things like nginx can serve it
if (nconf.get('isPrimary') === 'true') {
Meta.css.commitToFile(destination);
}
Meta.css[destination] = result.css;
// Save the compiled CSS in public/ so things like nginx can serve it
if (nconf.get('isPrimary') === 'true') {
Meta.css.commitToFile(destination);
}
if (typeof callback === 'function') {
callback(null, result.css);
}
});
if (typeof callback === 'function') {
callback(null, lessOutput.css);
}
});
}

Loading…
Cancel
Save