From 5123b573200f976889bac882418fbccf7dd61b91 Mon Sep 17 00:00:00 2001 From: KoloMl Date: Thu, 26 Feb 2026 02:33:15 +0400 Subject: [PATCH] Fixed content scripts not properly receiving Tantabus constant --- .vite/lib/content-scripts.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.vite/lib/content-scripts.js b/.vite/lib/content-scripts.js index 35b12a6..88baf7b 100644 --- a/.vite/lib/content-scripts.js +++ b/.vite/lib/content-scripts.js @@ -174,6 +174,15 @@ export async function buildScriptsAndStyles(buildOptions) { } }); + const tantabusSwapPlugin = SwapDefinedVariablesPlugin({ + envVariable: 'SITE', + expectedValue: 'tantabus', + define: { + __CURRENT_SITE__: JSON.stringify('tantabus'), + __CURRENT_SITE_NAME__: JSON.stringify('Tantabus'), + } + }); + // Building all scripts together with AMD loader in mind await build({ configFile: false, @@ -209,6 +218,7 @@ export async function buildScriptsAndStyles(buildOptions) { ?.push(...dependencies); }), derpibooruSwapPlugin, + tantabusSwapPlugin, ], define: defineConstants, }); @@ -235,6 +245,7 @@ export async function buildScriptsAndStyles(buildOptions) { wrapScriptIntoIIFE(), ScssViteReadEnvVariableFunctionPlugin(), derpibooruSwapPlugin, + tantabusSwapPlugin, ], define: defineConstants, });