MultiModuleFactory.js 489 B

1234567891011121314151617181920212223
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. const { Tapable } = require("tapable");
  7. const MultiModule = require("./MultiModule");
  8. module.exports = class MultiModuleFactory extends Tapable {
  9. constructor() {
  10. super();
  11. this.hooks = {};
  12. }
  13. create(data, callback) {
  14. const dependency = data.dependencies[0];
  15. callback(
  16. null,
  17. new MultiModule(data.context, dependency.dependencies, dependency.name)
  18. );
  19. }
  20. };