|
@@ -10,24 +10,23 @@ class PluginUtils {
|
|
|
* name: 'crowi-plugin-X',
|
|
* name: 'crowi-plugin-X',
|
|
|
* meta: require('crowi-plugin-X'),
|
|
* meta: require('crowi-plugin-X'),
|
|
|
* entries: [
|
|
* entries: [
|
|
|
- * require('crowi-plugin-X/lib/client-entry')
|
|
|
|
|
|
|
+ * 'crowi-plugin-X/lib/client-entry'
|
|
|
* ]
|
|
* ]
|
|
|
* }
|
|
* }
|
|
|
*
|
|
*
|
|
|
|
|
+ *
|
|
|
* @param {string} pluginName
|
|
* @param {string} pluginName
|
|
|
* @return
|
|
* @return
|
|
|
* @memberOf PluginService
|
|
* @memberOf PluginService
|
|
|
*/
|
|
*/
|
|
|
- generatePluginDefinition(pluginName, isForClient = false) {
|
|
|
|
|
- const meta = require(pluginName);
|
|
|
|
|
|
|
+ generatePluginDefinition(name, isForClient = false) {
|
|
|
|
|
+ const meta = require(name);
|
|
|
const entries = (isForClient) ? meta.clientEntries : meta.serverEntries;
|
|
const entries = (isForClient) ? meta.clientEntries : meta.serverEntries;
|
|
|
|
|
|
|
|
return {
|
|
return {
|
|
|
- name: pluginName,
|
|
|
|
|
- meta: meta,
|
|
|
|
|
- entries: entries.map((entryPath) => {
|
|
|
|
|
- return require(entryPath);
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ name,
|
|
|
|
|
+ meta,
|
|
|
|
|
+ entries,
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|