MCPcopy
hub / github.com/webpack/webpack / getSourceForAmdOrUmdExternal

Function getSourceForAmdOrUmdExternal

lib/ExternalModule.js:718–737  ·  view source on GitHub ↗
(
	id,
	optional,
	request,
	runtimeTemplate
)

Source from the content-addressed store, hash-verified

716 * @returns {SourceData} the generated source
717 */
718const getSourceForAmdOrUmdExternal = (
719 id,
720 optional,
721 request,
722 runtimeTemplate
723) => {
724 const externalVariable = `__WEBPACK_EXTERNAL_MODULE_${Template.toIdentifier(
725 `${id}`
726 )}__`;
727 return {
728 init: optional
729 ? checkExternalVariable(
730 externalVariable,
731 Array.isArray(request) ? request.join(".") : request,
732 runtimeTemplate
733 )
734 : undefined,
735 expression: externalVariable
736 };
737};
738
739/**
740 * Gets source for default case.

Callers 1

_getSourceDataMethod · 0.85

Calls 3

checkExternalVariableFunction · 0.85
toIdentifierMethod · 0.80
isArrayMethod · 0.80

Tested by

no test coverage detected