Skip to main content
Version: 3x

Interface: CompilerDelegate

Delegate with implementation for compiler-specific functions.

Table of contents

Methods

Methods

getAsset

getAsset(filename, platform, sendProgress?): Promise<string | Buffer>

Get compiled asset content.

If the compilation is in progress, it should wait until compilation finishes and then return the asset.

Parameters

NameTypeDescription
filenamestringFilename of the asset to get.
platformstringPlatform of the asset to get.
sendProgress?SendProgressFunction to notify the client who requested the asset about compilation progress.

Returns

Promise<string | Buffer>

Defined in

plugins/compiler/types.ts:16


getMimeType

getMimeType(filename, platform, data): string

Detect MIME type of the asset from filename, platform or data (or from combination of either).

Parameters

NameTypeDescription
filenamestringFilename of the asset.
platformstringPlatform of the asset.
datastring | BufferAsset's content.

Returns

string

Defined in

plugins/compiler/types.ts:29


inferPlatform

Optional inferPlatform(uri): undefined | string

Detect the platform from the URI - either from filename, query params or both.

Parameters

NameTypeDescription
uristringURI string.

Returns

undefined | string

Defined in

plugins/compiler/types.ts:40