Skip to content

Commit

Permalink
fix: hmr doesn't work properly in paths with the character '.' (#5703)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgmachado authored Nov 25, 2022
1 parent cfaa882 commit 7a312a2
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/services/webpack/webpack-compiler-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 7a312a2

Please sign in to comment.