Skip to content

Commit

Permalink
Make content hash consistent across machines
Browse files Browse the repository at this point in the history
The metadata used for calculating the content/chunk hash by webpack was including the absolute paths for all the definition files and additional dependencies, which caused the calculated hash to be different depending on the absolute path of the root context. This caused the hash to change between different machines even if there were no changes in the code, which in turn causes issues in certain deployment environments where the build is executed in different server, as is the case in the default Rails deployments in AWS OpsWorks.
This commit changes the paths added to the build metadata to be relative to the root context, which makes the content/chunk hash calculation consistent across builds in different machines.
  • Loading branch information
elyalvarado committed Apr 9, 2020
1 parent d0c4b41 commit d95227f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ function getEmit(
.concat(additionalDependencies)
.map(
defFilePath =>
defFilePath +
path.relative(loaderContext.rootContext,defFilePath) +
'@' +
(instance.files.get(defFilePath) || { version: '?' }).version
);
Expand Down

0 comments on commit d95227f

Please sign in to comment.