2
0

plugin-loader-v2.model.js 420 B

12345678910111213141516171819202122
  1. const debug = require('debug')('crowi:plugins:PluginLoaderV2');
  2. class PluginLoaderV2 {
  3. loadForServer(name, crowi, app) {
  4. const meta = require(name);
  5. const entries = meta.serverEntries
  6. .map(function(entryPath) {
  7. return require(entryPath);
  8. });
  9. debug(`load plugin '${name}'`);
  10. entries.forEach((entry) => {
  11. entry(crowi, app);
  12. });
  13. }
  14. }
  15. module.exports = PluginLoaderV2;