From 366856f3bcdc2ff008b04e493a5de317ab83d5d0 Mon Sep 17 00:00:00 2001 From: diondiondion Date: Wed, 19 Nov 2025 13:37:15 +0100 Subject: [PATCH] Fix theme-related Vite errors even when `theme_tokens` feature flag is disabled (#36936) --- config/vite/plugin-mastodon-themes.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/config/vite/plugin-mastodon-themes.ts b/config/vite/plugin-mastodon-themes.ts index 3e7bc7a8a8f..98bda4cab0e 100644 --- a/config/vite/plugin-mastodon-themes.ts +++ b/config/vite/plugin-mastodon-themes.ts @@ -40,13 +40,15 @@ export function MastodonThemes(): Plugin { // Get all files mentioned in the themes.yml file. const themes = await loadThemesFromConfig(projectRoot); + const allThemes = { + ...themes, + default_theme_tokens: 'styles_new/application.scss', + 'mastodon-light_theme_tokens': 'styles_new/mastodon-light.scss', + contrast_theme_tokens: 'styles_new/contrast.scss', + }; - for (const [themeName, themePath] of Object.entries(themes)) { + for (const [themeName, themePath] of Object.entries(allThemes)) { entrypoints[`themes/${themeName}`] = path.resolve(jsRoot, themePath); - entrypoints[`themes/${themeName}_theme_tokens`] = path.resolve( - jsRoot, - themePath.replace('styles/', 'styles_new/'), - ); } return {