diff --git a/src/plugins.js b/src/plugins.js index 32d902b03b..d861f972fb 100644 --- a/src/plugins.js +++ b/src/plugins.js @@ -198,8 +198,18 @@ var fs = require('fs'), } Plugins.cssFiles = Plugins.cssFiles.concat(pluginData.css.map(function(file) { - return path.join(pluginData.id, 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(); diff --git a/src/routes/meta.js b/src/routes/meta.js index 3b5fbed3f7..0629bc25a7 100644 --- a/src/routes/meta.js +++ b/src/routes/meta.js @@ -28,7 +28,7 @@ var path = require('path'), // ... and for each CSS file for(x=0,numCSS=plugins.cssFiles.length;x