Don't use theme-name in manifest file names

This commit is contained in:
RMidhunSuresh 2022-06-20 12:54:18 +05:30
parent 623939c671
commit e3372f0f2b

View file

@ -257,8 +257,10 @@ module.exports = function buildThemes(options) {
const derivedVariables = compiledVariables["derived-variables"]; const derivedVariables = compiledVariables["derived-variables"];
const icon = compiledVariables["icon"]; const icon = compiledVariables["icon"];
const builtAssets = {}; const builtAssets = {};
let themeKey;
for (const chunk of chunkArray) { for (const chunk of chunkArray) {
const [, name, variant] = chunk.fileName.match(/theme-(.+)-(.+)\.css/); const [, name, variant] = chunk.fileName.match(/theme-(.+)-(.+)\.css/);
themeKey = name;
builtAssets[`${name}-${variant}`] = assetMap.get(chunk.fileName).fileName; builtAssets[`${name}-${variant}`] = assetMap.get(chunk.fileName).fileName;
} }
manifest.source = { manifest.source = {
@ -267,7 +269,7 @@ module.exports = function buildThemes(options) {
"derived-variables": derivedVariables, "derived-variables": derivedVariables,
"icon": icon "icon": icon
}; };
const name = `theme-${manifest.name}.json`; const name = `theme-${themeKey}.json`;
manifestLocations.push(`assets/${name}`); manifestLocations.push(`assets/${name}`);
this.emitFile({ this.emitFile({
type: "asset", type: "asset",