* Builds the module using the provided compilation context. * @param {WebpackOptions} options webpack options * @param {Compilation} compilation the compilation * @param {ResolverWithOptions} resolver the resolver * @param {InputFileSystem} fs the file system * @param {BuildCallback} callb
(options, compilation, resolver, fs, callback)
| 120 | * @returns {void} |
| 121 | */ |
| 122 | build(options, compilation, resolver, fs, callback) { |
| 123 | this.buildMeta = {}; |
| 124 | this.buildInfo = { |
| 125 | strict: true, |
| 126 | topLevelDeclarations: new Set(["moduleMap", "get", "init"]) |
| 127 | }; |
| 128 | this.buildMeta.exportsType = "namespace"; |
| 129 | |
| 130 | this.clearDependenciesAndBlocks(); |
| 131 | |
| 132 | for (const [name, options] of this._exposes) { |
| 133 | const block = new AsyncDependenciesBlock( |
| 134 | { |
| 135 | name: options.name |
| 136 | }, |
| 137 | { name }, |
| 138 | options.import[options.import.length - 1] |
| 139 | ); |
| 140 | let idx = 0; |
| 141 | for (const request of options.import) { |
| 142 | const dep = new ContainerExposedDependency(name, request); |
| 143 | dep.loc = { |
| 144 | name, |
| 145 | index: idx++ |
| 146 | }; |
| 147 | |
| 148 | block.addDependency(dep); |
| 149 | } |
| 150 | this.addBlock(block); |
| 151 | } |
| 152 | this.addDependency(new StaticExportsDependency(["get", "init"], false)); |
| 153 | |
| 154 | callback(); |
| 155 | } |
| 156 | |
| 157 | /** |
| 158 | * Generates code and runtime requirements for this module. |
nothing calls this directly
no test coverage detected