2013-01-31 08:44:39 +08:00
|
|
|
/*
|
|
|
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
|
|
Author Tobias Koppers @sokra
|
|
|
|
*/
|
2017-02-22 03:13:40 +08:00
|
|
|
"use strict";
|
|
|
|
|
2017-11-28 16:54:24 +08:00
|
|
|
const Tapable = require("tapable").Tapable;
|
2017-02-22 02:51:12 +08:00
|
|
|
const MultiModule = require("./MultiModule");
|
2013-01-31 08:44:39 +08:00
|
|
|
|
2017-02-22 02:51:12 +08:00
|
|
|
module.exports = class MultiModuleFactory extends Tapable {
|
2017-02-22 03:17:24 +08:00
|
|
|
constructor() {
|
2017-02-22 02:51:12 +08:00
|
|
|
super();
|
2017-11-28 16:54:24 +08:00
|
|
|
this.hooks = {};
|
2017-02-22 02:51:12 +08:00
|
|
|
}
|
2013-01-31 08:44:39 +08:00
|
|
|
|
2017-02-22 02:51:12 +08:00
|
|
|
create(data, callback) {
|
|
|
|
const dependency = data.dependencies[0];
|
|
|
|
callback(null, new MultiModule(data.context, dependency.dependencies, dependency.name));
|
|
|
|
}
|
2013-01-31 08:44:39 +08:00
|
|
|
};
|