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 {@link 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
Name Type Description
scriptId string Id of the script to resolve.
caller? string Name 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:135