From 4cbde274aefff64a6d59616c83a7d99cd8affd72 Mon Sep 17 00:00:00 2001 From: vialoh Date: Thu, 28 Sep 2023 14:23:26 +0200 Subject: [PATCH] :rotating_light: Treat index types as strings --- src/ExtensionReloader.ts | 4 ++-- src/middleware/middleware-injector.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ExtensionReloader.ts b/src/ExtensionReloader.ts index 25f19a14..59194b04 100644 --- a/src/ExtensionReloader.ts +++ b/src/ExtensionReloader.ts @@ -35,8 +35,8 @@ export default class ExtensionReloaderImpl extends AbstractPluginReloader implem // eslint-disable-next-line no-restricted-syntax for (const chunk of chunks) { - const oldVersion = this._chunkVersions[chunk.name]; - this._chunkVersions[chunk.name] = chunk.hash; + const oldVersion = this._chunkVersions[chunk.name as string]; + this._chunkVersions[chunk.name as string] = chunk.hash; if (chunk.hash !== oldVersion) { changedChunks.push(chunk); } diff --git a/src/middleware/middleware-injector.ts b/src/middleware/middleware-injector.ts index 82551c52..97cac2c0 100644 --- a/src/middleware/middleware-injector.ts +++ b/src/middleware/middleware-injector.ts @@ -16,7 +16,7 @@ const middlewareInjector: MiddlewareInjector = ({ background, contentScript, ext return (assets, chunks: Compilation["chunks"]) => Array.from(chunks).reduce((prev, { name, files }) => { - if (matchBgOrContentOrPage(name)) { + if (matchBgOrContentOrPage(name as string)) { files.forEach((entryPoint) => { if (/\.js$/.test(entryPoint)) { const finalSrc = sourceFactory(source, assets[entryPoint]);