mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
Resolve merge conflicts, minify only .js files
This commit is contained in:
@@ -41,6 +41,7 @@ module.exports = function (Plugins) {
|
||||
Plugins.lessFiles.length = 0;
|
||||
Plugins.clientScripts.length = 0;
|
||||
Plugins.acpScripts.length = 0;
|
||||
Plugins.soundpacks.length = 0;
|
||||
|
||||
async.waterfall([
|
||||
async.apply(Plugins.getPluginPaths),
|
||||
@@ -57,6 +58,7 @@ module.exports = function (Plugins) {
|
||||
async.apply(mapClientSideScripts, pluginData),
|
||||
async.apply(mapClientModules, pluginData),
|
||||
async.apply(mapStaticDirectories, pluginData, pluginData.path),
|
||||
async.apply(mapSoundpack, pluginData),
|
||||
], next);
|
||||
}, next);
|
||||
},
|
||||
@@ -93,6 +95,9 @@ module.exports = function (Plugins) {
|
||||
function (next) {
|
||||
mapClientModules(pluginData, next);
|
||||
},
|
||||
function (next) {
|
||||
mapSoundpack(pluginData, next);
|
||||
},
|
||||
], function (err) {
|
||||
if (err) {
|
||||
winston.verbose('[plugins] Could not load plugin : ' + pluginData.id);
|
||||
@@ -251,6 +256,35 @@ module.exports = function (Plugins) {
|
||||
callback();
|
||||
}
|
||||
|
||||
function mapSoundpack(pluginData, callback) {
|
||||
var soundpack = pluginData.soundpack;
|
||||
if (!soundpack || !soundpack.dir || !soundpack.sounds) {
|
||||
return callback();
|
||||
}
|
||||
soundpack.name = soundpack.name || pluginData.name;
|
||||
soundpack.id = pluginData.id;
|
||||
soundpack.dir = path.join(pluginData.path, soundpack.dir);
|
||||
async.each(Object.keys(soundpack.sounds), function (key, next) {
|
||||
file.exists(path.join(soundpack.dir, soundpack.sounds[key]), function (exists) {
|
||||
if (!exists) {
|
||||
delete soundpack.sounds[key];
|
||||
}
|
||||
|
||||
next();
|
||||
});
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
if (Object.keys(soundpack.sounds).length) {
|
||||
Plugins.soundpacks.push(soundpack);
|
||||
}
|
||||
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
function resolveModulePath(fullPath, relPath) {
|
||||
/**
|
||||
* With npm@3, dependencies can become flattened, and appear at the root level.
|
||||
|
||||
Reference in New Issue
Block a user