mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
Emit runtime bundle
This commit is contained in:
parent
32eb95734a
commit
86c45b5b99
@ -38,8 +38,8 @@ module.exports = function buildThemes(options) {
|
|||||||
for (const location of manifestLocations) {
|
for (const location of manifestLocations) {
|
||||||
manifest = require(`${location}/manifest.json`);
|
manifest = require(`${location}/manifest.json`);
|
||||||
variants = manifest.values.variants;
|
variants = manifest.values.variants;
|
||||||
for (const [variant, details] of Object.entries(variants)) {
|
|
||||||
const themeName = manifest.name;
|
const themeName = manifest.name;
|
||||||
|
for (const [variant, details] of Object.entries(variants)) {
|
||||||
const fileName = `theme-${themeName}-${variant}.css`;
|
const fileName = `theme-${themeName}-${variant}.css`;
|
||||||
if (details.default) {
|
if (details.default) {
|
||||||
// This theme is the default for when Hydrogen launches for the first time
|
// This theme is the default for when Hydrogen launches for the first time
|
||||||
@ -57,6 +57,12 @@ module.exports = function buildThemes(options) {
|
|||||||
fileName,
|
fileName,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// emit the css as runtime theme bundle
|
||||||
|
this.emitFile({
|
||||||
|
type: "chunk",
|
||||||
|
id: `${location}/theme.css`,
|
||||||
|
fileName: `theme-${themeName}-runtime.css`,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user