mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
fixed issue where plugin css and js wasn't loaded -- also less files no longer blow up
This commit is contained in:
@@ -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')),
|
baseThemePath = path.join(nconf.get('themes_path'), (themeData['theme:type'] && themeData['theme:type'] === 'local' ? themeId : 'nodebb-theme-vanilla')),
|
||||||
paths = [
|
paths = [
|
||||||
baseThemePath,
|
baseThemePath,
|
||||||
path.join(__dirname, '../../node_modules'),
|
path.join(__dirname, '../node_modules'),
|
||||||
path.join(__dirname, '../public/vendor/fontawesome/less'),
|
path.join(__dirname, '../public/vendor/fontawesome/less')
|
||||||
path.join(__dirname, '../public/vendor/fontawesome/fonts')
|
|
||||||
],
|
],
|
||||||
source = '@import "./theme";\n@import "font-awesome";',
|
source = '@import "./theme";\n@import "font-awesome";',
|
||||||
x, numLESS, numCSS;
|
x, numLESS, numCSS;
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ var fs = require('fs'),
|
|||||||
Plugins.loadPlugin = function(pluginPath, callback) {
|
Plugins.loadPlugin = function(pluginPath, callback) {
|
||||||
fs.readFile(path.join(pluginPath, 'plugin.json'), function(err, data) {
|
fs.readFile(path.join(pluginPath, 'plugin.json'), function(err, data) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return callback(pluginPath.match('nodebb-theme') ? null : err);
|
return callback(pluginPath.match('nodebb-theme') ? null : err);
|
||||||
}
|
}
|
||||||
|
|
||||||
var pluginData = JSON.parse(data),
|
var pluginData = JSON.parse(data),
|
||||||
@@ -164,7 +164,7 @@ var fs = require('fs'),
|
|||||||
Plugins.staticDirs[pluginData.id] = path.join(pluginPath, pluginData.staticDir);
|
Plugins.staticDirs[pluginData.id] = path.join(pluginPath, pluginData.staticDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(key in pluginData.staticDirs) {
|
for(var key in pluginData.staticDirs) {
|
||||||
(function(mappedPath) {
|
(function(mappedPath) {
|
||||||
if (pluginData.staticDirs.hasOwnProperty(mappedPath)) {
|
if (pluginData.staticDirs.hasOwnProperty(mappedPath)) {
|
||||||
if (Plugins.staticDirs[mappedPath]) {
|
if (Plugins.staticDirs[mappedPath]) {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ var path = require('path'),
|
|||||||
user = require('./user'),
|
user = require('./user'),
|
||||||
notifications = require('./notifications'),
|
notifications = require('./notifications'),
|
||||||
logger = require('./logger'),
|
logger = require('./logger'),
|
||||||
|
plugins = require('./plugins'),
|
||||||
middleware = require('./middleware'),
|
middleware = require('./middleware'),
|
||||||
routes = require('./routes'),
|
routes = require('./routes'),
|
||||||
emitter = require('./emitter');
|
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');
|
winston.info('Using ports 80 and 443 is not recommend; use a proxy instead. See README.md');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prepare js for minification/concatenation
|
plugins.ready(function() {
|
||||||
meta.js.prepare(function() {
|
// Prepare js for minification/concatenation
|
||||||
if (app.enabled('minification')) {
|
meta.js.prepare(function() {
|
||||||
meta.js.minify();
|
if (app.enabled('minification')) {
|
||||||
} else {
|
meta.js.minify();
|
||||||
meta.js.concatenate();
|
} else {
|
||||||
}
|
meta.js.concatenate();
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Minify CSS
|
// Minify CSS
|
||||||
meta.css.minify();
|
meta.css.minify();
|
||||||
|
});
|
||||||
|
|
||||||
module.exports.server = server;
|
module.exports.server = server;
|
||||||
module.exports.init = function () {
|
module.exports.init = function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user