From 926d875de7016b11d56a746777613b2850ed4b44 Mon Sep 17 00:00:00 2001 From: amsyarasyiq <82711525+amsyarasyiq@users.noreply.github.com> Date: Fri, 10 May 2024 02:18:01 +0800 Subject: [PATCH] feat(plugins): include plugin hash in sourceURL for caching --- src/index.ts | 2 -- src/lib/managers/plugins.ts | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index d7a0135..0da123e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,7 +3,6 @@ import { initFetchI18nStrings } from "@core/i18n"; import { initCorePlugins } from "@core/plugins"; import initSettings from "@core/ui/settings"; import { initVendettaObject } from "@core/vendettaObject"; -import { patchAssets } from "@lib/api/assets"; import { patchCommands } from "@lib/api/commands"; import { injectFluxInterceptor } from "@lib/api/flux"; import { removeFile, writeFile } from "@lib/api/native/fs"; @@ -41,7 +40,6 @@ export default async () => { injectFluxInterceptor(), patchSettings(), patchLogHook(), - patchAssets(), patchCommands(), patchChatBackground(), initVendettaObject(), diff --git a/src/lib/managers/plugins.ts b/src/lib/managers/plugins.ts index b4e61e2..9fb85d0 100644 --- a/src/lib/managers/plugins.ts +++ b/src/lib/managers/plugins.ts @@ -97,7 +97,7 @@ export async function evalPlugin(plugin: BunnyPlugin) { }, logger: new logModule(`Bunny ยป ${plugin.manifest.name}`), }; - const pluginString = `vendetta=>{return ${plugin.js}}\n//# sourceURL=${plugin.id}`; + const pluginString = `vendetta=>{return ${plugin.js}}\n//# sourceURL=${plugin.id}?hash=${plugin.manifest.hash}`; const raw = (0, eval)(pluginString)(vendettaForPlugins); const ret = typeof raw === "function" ? raw() : raw;