backwards compatibility with older plugins using css with staticDir

v1.18.x
Julian Lam 11 years ago
parent 6a31bd9af6
commit 90b29031fe

@ -198,8 +198,18 @@ var fs = require('fs'),
}
Plugins.cssFiles = Plugins.cssFiles.concat(pluginData.css.map(function(file) {
if (fs.existsSync(path.join(__dirname, '../node_modules', pluginData.id, file))) {
return path.join(pluginData.id, file);
}));
} else {
// Backwards compatibility with < v0.4.0, remove this for v0.5.0
if (pluginData.staticDir) {
return path.join(pluginData.id, pluginData.staticDir, file);
} else {
winston.error('[plugins/' + pluginData.id + '] This plugin\'s CSS is incorrectly configured, please contact the plugin author.');
return null;
}
}
}).filter(function(path) { return path })); // Filter out nulls, remove this for v0.5.0
}
next();

@ -28,7 +28,7 @@ var path = require('path'),
// ... and for each CSS file
for(x=0,numCSS=plugins.cssFiles.length;x<numCSS;x++) {
source += '\n@import (less) "./' + plugins.cssFiles[x] + '";';
source += '\n@import (inline) "./' + plugins.cssFiles[x] + '";';
}
var parser = new (less.Parser)({

Loading…
Cancel
Save