Skip to content

Commit 7a312a2

Browse files
authored
fix: hmr doesn't work properly in paths with the character '.' (#5703)
1 parent cfaa882 commit 7a312a2

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/services/webpack/webpack-compiler-service.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -551,18 +551,17 @@ export class WebpackCompilerService
551551
path.join(platformData.appDestinationDirectoryPath, "app", asset)
552552
);
553553

554-
// console.log({ staleFiles });
555-
556554
// extract last hash from emitted filenames
557555
const lastHash = (() => {
558-
const fileWithLastHash = files.find((fileName: string) =>
556+
const absoluteFileNameWithLastHash = files.find((fileName: string) =>
559557
fileName.endsWith("hot-update.js")
560558
);
561-
562-
if (!fileWithLastHash) {
559+
560+
if (!absoluteFileNameWithLastHash) {
563561
return null;
564562
}
565-
const matches = fileWithLastHash.match(/\.(.+).hot-update\.js/);
563+
const fileNameWithLastHash = path.basename(absoluteFileNameWithLastHash);
564+
const matches = fileNameWithLastHash.match(/\.(.+).hot-update\.js/);
566565

567566
if (matches) {
568567
return matches[1];

0 commit comments

Comments
 (0)