UNPKG

1.01 kBJavaScriptView Raw
1/*
2 MIT License http://www.opensource.org/licenses/mit-license.php
3 Author Tobias Koppers @sokra
4*/
5
6"use strict";
7
8const DllModule = require("./DllModule");
9const ModuleFactory = require("./ModuleFactory");
10
11/** @typedef {import("./ModuleFactory").ModuleFactoryCreateData} ModuleFactoryCreateData */
12/** @typedef {import("./ModuleFactory").ModuleFactoryResult} ModuleFactoryResult */
13/** @typedef {import("./dependencies/DllEntryDependency")} DllEntryDependency */
14
15class DllModuleFactory extends ModuleFactory {
16 constructor() {
17 super();
18 this.hooks = Object.freeze({});
19 }
20 /**
21 * @param {ModuleFactoryCreateData} data data object
22 * @param {function(Error=, ModuleFactoryResult=): void} callback callback
23 * @returns {void}
24 */
25 create(data, callback) {
26 const dependency = /** @type {DllEntryDependency} */ (data.dependencies[0]);
27 callback(null, {
28 module: new DllModule(
29 data.context,
30 dependency.dependencies,
31 dependency.name
32 )
33 });
34 }
35}
36
37module.exports = DllModuleFactory;