|
|
|
@ -195,25 +195,19 @@ module.exports = function (Plugins) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function mapClientSideScripts(pluginData, callback) {
|
|
|
|
|
if (Array.isArray(pluginData.scripts)) {
|
|
|
|
|
if (global.env === 'development') {
|
|
|
|
|
winston.verbose('[plugins] Found ' + pluginData.scripts.length + ' js file(s) for plugin ' + pluginData.id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Plugins.clientScripts = Plugins.clientScripts.concat(pluginData.scripts.map(function (file) {
|
|
|
|
|
return resolveModulePath(path.join(__dirname, '../../node_modules/', pluginData.id, file), file);
|
|
|
|
|
})).filter(Boolean);
|
|
|
|
|
}
|
|
|
|
|
function mapScripts(scripts, globalScripts) {
|
|
|
|
|
if (Array.isArray(scripts) && scripts.length) {
|
|
|
|
|
if (global.env === 'development') {
|
|
|
|
|
winston.verbose('[plugins] Found ' + scripts.length + ' js file(s) for plugin ' + pluginData.id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Array.isArray(pluginData.acpScripts)) {
|
|
|
|
|
if (global.env === 'development') {
|
|
|
|
|
winston.verbose('[plugins] Found ' + pluginData.acpScripts.length + ' ACP js file(s) for plugin ' + pluginData.id);
|
|
|
|
|
globalScripts = globalScripts.concat(scripts.map(function (file) {
|
|
|
|
|
return resolveModulePath(path.join(__dirname, '../../node_modules/', pluginData.id, file), file);
|
|
|
|
|
})).filter(Boolean);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Plugins.acpScripts = Plugins.acpScripts.concat(pluginData.acpScripts.map(function (file) {
|
|
|
|
|
return resolveModulePath(path.join(__dirname, '../../node_modules/', pluginData.id, file), file);
|
|
|
|
|
})).filter(Boolean);
|
|
|
|
|
}
|
|
|
|
|
mapScripts(pluginData.scripts, Plugins.clientScripts);
|
|
|
|
|
mapScripts(pluginData.acpScripts, Plugins.acpScripts);
|
|
|
|
|
|
|
|
|
|
callback();
|
|
|
|
|
}
|
|
|
|
|