Skip to main content
Version: 3x

Type alias: ScriptLocatorResolver

Ƭ ScriptLocatorResolver: (scriptId: string, caller?: string) => Promise\<ScriptLocator | undefined>

Type declaration

▸ (scriptId, caller?): Promise\<ScriptLocator | undefined>

Defines a function to resolve a script locator used in ScriptManagerConfig. It's an async function which should return an object with data on how ScriptManager should fetch the script. All fields describing the script locator data are listed in ScriptLocator.

Return undefined if the script should be resolved by other resolvers instead.

Parameters
NameTypeDescription
scriptIdstringId of the script to resolve.
caller?stringName of the calling script - it can be for example: name of the bundle, chunk or container.
Returns

Promise\<ScriptLocator | undefined>

Defined in

packages/repack/src/modules/ScriptManager/types.ts:133