fixed issue where plugin css and js wasn't loaded -- also less files no longer blow up

v1.18.x
Julian Lam 11 years ago
parent c2f6717e88
commit 17dd113a94

@ -332,9 +332,8 @@ var fs = require('fs'),
baseThemePath = path.join(nconf.get('themes_path'), (themeData['theme:type'] && themeData['theme:type'] === 'local' ? themeId : 'nodebb-theme-vanilla')),
paths = [
baseThemePath,
path.join(__dirname, '../../node_modules'),
path.join(__dirname, '../public/vendor/fontawesome/less'),
path.join(__dirname, '../public/vendor/fontawesome/fonts')
path.join(__dirname, '../node_modules'),
path.join(__dirname, '../public/vendor/fontawesome/less')
],
source = '@import "./theme";\n@import "font-awesome";',
x, numLESS, numCSS;

@ -109,7 +109,7 @@ var fs = require('fs'),
Plugins.loadPlugin = function(pluginPath, callback) {
fs.readFile(path.join(pluginPath, 'plugin.json'), function(err, data) {
if (err) {
return callback(pluginPath.match('nodebb-theme') ? null : err);
return callback(pluginPath.match('nodebb-theme') ? null : err);
}
var pluginData = JSON.parse(data),
@ -164,7 +164,7 @@ var fs = require('fs'),
Plugins.staticDirs[pluginData.id] = path.join(pluginPath, pluginData.staticDir);
}
for(key in pluginData.staticDirs) {
for(var key in pluginData.staticDirs) {
(function(mappedPath) {
if (pluginData.staticDirs.hasOwnProperty(mappedPath)) {
if (Plugins.staticDirs[mappedPath]) {

@ -15,6 +15,7 @@ var path = require('path'),
user = require('./user'),
notifications = require('./notifications'),
logger = require('./logger'),
plugins = require('./plugins'),
middleware = require('./middleware'),
routes = require('./routes'),
emitter = require('./emitter');
@ -86,17 +87,19 @@ if(nconf.get('ssl')) {
winston.info('Using ports 80 and 443 is not recommend; use a proxy instead. See README.md');
}
// Prepare js for minification/concatenation
meta.js.prepare(function() {
if (app.enabled('minification')) {
meta.js.minify();
} else {
meta.js.concatenate();
}
});
plugins.ready(function() {
// Prepare js for minification/concatenation
meta.js.prepare(function() {
if (app.enabled('minification')) {
meta.js.minify();
} else {
meta.js.concatenate();
}
});
// Minify CSS
meta.css.minify();
// Minify CSS
meta.css.minify();
});
module.exports.server = server;
module.exports.init = function () {

Loading…
Cancel
Save