main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
844 bytes
|
Rev | Line | |
---|
[79a0317] | 1 | /*
|
---|
| 2 | MIT License http://www.opensource.org/licenses/mit-license.php
|
---|
| 3 | Author Tobias Koppers @sokra
|
---|
| 4 | */
|
---|
| 5 |
|
---|
| 6 | "use strict";
|
---|
| 7 |
|
---|
| 8 | /** @typedef {import("./ModuleFactory").ModuleFactoryCreateData} ModuleFactoryCreateData */
|
---|
| 9 | /** @typedef {import("./ModuleFactory").ModuleFactoryResult} ModuleFactoryResult */
|
---|
| 10 | /** @typedef {import("./ModuleGraph")} ModuleGraph */
|
---|
| 11 |
|
---|
| 12 | class SelfModuleFactory {
|
---|
| 13 | /**
|
---|
| 14 | * @param {ModuleGraph} moduleGraph module graph
|
---|
| 15 | */
|
---|
| 16 | constructor(moduleGraph) {
|
---|
| 17 | this.moduleGraph = moduleGraph;
|
---|
| 18 | }
|
---|
| 19 |
|
---|
| 20 | /**
|
---|
| 21 | * @param {ModuleFactoryCreateData} data data object
|
---|
| 22 | * @param {function((Error | null)=, ModuleFactoryResult=): void} callback callback
|
---|
| 23 | * @returns {void}
|
---|
| 24 | */
|
---|
| 25 | create(data, callback) {
|
---|
| 26 | const module = this.moduleGraph.getParentModule(data.dependencies[0]);
|
---|
| 27 | callback(null, {
|
---|
| 28 | module
|
---|
| 29 | });
|
---|
| 30 | }
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | module.exports = SelfModuleFactory;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.