MCPcopy
hub / github.com/webpack/webpack / finishEntryModule

Method finishEntryModule

lib/library/AssignLibraryPlugin.js:179–198  ·  view source on GitHub ↗

* Finish entry module. * @param {Module} module the exporting entry module * @param {string} entryName the name of the entrypoint * @param {LibraryContext<T>} libraryContext context * @returns {void}

(
		module,
		entryName,
		{ options, compilation, compilation: { moduleGraph } }
	)

Source from the content-addressed store, hash-verified

177 * @returns {void}
178 */
179 finishEntryModule(
180 module,
181 entryName,
182 { options, compilation, compilation: { moduleGraph } }
183 ) {
184 const runtime = getEntryRuntime(compilation, entryName);
185 if (options.export) {
186 const exportsInfo = moduleGraph.getExportInfo(
187 module,
188 Array.isArray(options.export) ? options.export[0] : options.export
189 );
190 exportsInfo.setUsed(UsageState.Used, runtime);
191 exportsInfo.canMangleUse = false;
192 exportsInfo.canInlineUse = false;
193 } else {
194 const exportsInfo = moduleGraph.getExportsInfo(module);
195 exportsInfo.setUsedInUnknownWay(runtime);
196 }
197 moduleGraph.addExtraReason(module, "used as library export");
198 }
199
200 /**
201 * Returns the prefix.

Callers

nothing calls this directly

Calls 7

getEntryRuntimeFunction · 0.85
isArrayMethod · 0.80
setUsedMethod · 0.80
getExportsInfoMethod · 0.80
addExtraReasonMethod · 0.80
getExportInfoMethod · 0.45
setUsedInUnknownWayMethod · 0.45

Tested by

no test coverage detected