From 1ff86ae0ac888a536ab3ceab9d9470321ab90c5f Mon Sep 17 00:00:00 2001 From: Douglas Machado Date: Fri, 25 Nov 2022 14:36:25 -0300 Subject: [PATCH] fix: hmr doesn't work properly in paths with the character '.' --- lib/services/webpack/webpack-compiler-service.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/services/webpack/webpack-compiler-service.ts b/lib/services/webpack/webpack-compiler-service.ts index 85118b5b6d..d29084f196 100644 --- a/lib/services/webpack/webpack-compiler-service.ts +++ b/lib/services/webpack/webpack-compiler-service.ts @@ -551,18 +551,17 @@ export class WebpackCompilerService path.join(platformData.appDestinationDirectoryPath, "app", asset) ); - // console.log({ staleFiles }); - // extract last hash from emitted filenames const lastHash = (() => { - const fileWithLastHash = files.find((fileName: string) => + const absoluteFileNameWithLastHash = files.find((fileName: string) => fileName.endsWith("hot-update.js") ); - - if (!fileWithLastHash) { + + if (!absoluteFileNameWithLastHash) { return null; } - const matches = fileWithLastHash.match(/\.(.+).hot-update\.js/); + const fileNameWithLastHash = path.basename(absoluteFileNameWithLastHash); + const matches = fileNameWithLastHash.match(/\.(.+).hot-update\.js/); if (matches) { return matches[1];