Skip to content

Commit

Permalink
🚨 Treat index types as strings
Browse files Browse the repository at this point in the history
  • Loading branch information
vialoh committed Sep 28, 2023
1 parent b39cb90 commit 4cbde27
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/ExtensionReloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/middleware/middleware-injector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit 4cbde27

Please sign in to comment.