mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-11-20 03:25:52 +01:00
built-asset --> built-assets
This commit is contained in:
parent
e63440527a
commit
4ddfd3b508
@ -253,17 +253,17 @@ module.exports = function buildThemes(options) {
|
||||
const compiledVariables = options.compiledVariables.get(location);
|
||||
const derivedVariables = compiledVariables["derived-variables"];
|
||||
const icon = compiledVariables["icon"];
|
||||
const builtAsset = {};
|
||||
const builtAssets = {};
|
||||
/**
|
||||
* Generate a mapping from theme name to asset hashed location of said theme in build output.
|
||||
* This can be used to enumerate themes during runtime.
|
||||
*/
|
||||
for (const chunk of chunkArray) {
|
||||
const [, name, variant] = chunk.fileName.match(/theme-(.+)-(.+)\.css/);
|
||||
builtAsset[`${name}-${variant}`] = assetMap.get(chunk.fileName).fileName;
|
||||
builtAssets[`${name}-${variant}`] = assetMap.get(chunk.fileName).fileName;
|
||||
}
|
||||
manifest.source = {
|
||||
"built-asset": builtAsset,
|
||||
"built-assets": builtAssets,
|
||||
"runtime-asset": assetMap.get(runtimeThemeChunk.fileName).fileName,
|
||||
"derived-variables": derivedVariables,
|
||||
"icon": icon
|
||||
|
@ -37,10 +37,10 @@ export class ThemeLoader {
|
||||
.response();
|
||||
/*
|
||||
After build has finished, the source section of each theme manifest
|
||||
contains `built-asset` which is a mapping from the theme-name to the
|
||||
contains `built-assets` which is a mapping from the theme-name to the
|
||||
location of the css file in build.
|
||||
*/
|
||||
Object.assign(this._themeMapping, body["source"]["built-asset"]);
|
||||
Object.assign(this._themeMapping, body["source"]["built-assets"]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user