Methods
# assetHash(asset) → {string}
Get the fingerprint that the asset was assigned during compilation phase.
Parameters:
Name | Type | Description |
---|---|---|
asset |
string
|
The asset name |
The asset fingerprint
string
# assetPath(asset, host) → {string}
Get tha path to an asset
Parameters:
Name | Type | Description |
---|---|---|
asset |
string
|
The asset name (ex: "app.js") |
host |
string
|
The asset host (optional, this defaults to values from publisher.yml) |
Fully Qualified URL of the asset
string
# getAllChunks(…chunks) → {Array.<module:asset-helper~Chunk>}
Read the given chunks into memory. This is a synonym for warmupAssetCache
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
chunks |
string
|
<repeatable> |
The list of chunks |
Array.<module:asset-helper~Chunk>
# getChunk(chunk) → {module:asset-helper~Chunk}
Loads a chunk into memory, usually so that it can be embedded onto the page
Parameters:
Name | Type | Description |
---|---|---|
chunk |
string
|
The name of the chunk to be fetched (ex: "list") |
The loaded chunk
# getFilesForChunks(…chunks) → {Array.<string>}
Get a list of all JS and CSS files needed for a set of chunks
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
chunks |
string
|
<repeatable> |
The list of chunks |
Unique list of JS and CSS files for a set of chunks
Array.<string>
# readAsset(asset) → {string}
Return the contents of an asset as a string. This function will memoize the disk read, so that this function is much faster the next time.
Parameters:
Name | Type | Description |
---|---|---|
asset |
string
|
The asset name (ex: "app.js") |
The content of the asset
string
# serviceWorkerContents() → {string}
Get the contents of the service worker.
Service Worker Contents
string
# warmupAssetCache(…chunks) → {void}
Read the given chunks into memory. This is a synonym for getAllChunks
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
chunks |
string
|
<repeatable> |
The list of chunks |
void