Skip to content

Commit bbc6d81

Browse files
authored
Make content hash consistent across machines (#1085)
* Make content hash consistent across machines 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. * Update Changelog and package.json to v7.0.2
1 parent cc31287 commit bbc6d81

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## v7.0.2
4+
* [Make content hash consistent across machines](https://github.com/TypeStrong/ts-loader/pull/1085) - thanks @elyalvarado
5+
36
## v7.0.1
47
* [fix: watch-run](https://github.com/TypeStrong/ts-loader/pull/1083) - thanks @zn4rk
58

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ts-loader",
3-
"version": "7.0.1",
3+
"version": "7.0.2",
44
"description": "TypeScript loader for webpack",
55
"main": "index.js",
66
"types": "dist",

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ function getEmit(
528528

529529
loaderContext._module.buildMeta.tsLoaderDefinitionFileVersions = dependencies.map(
530530
defFilePath =>
531-
defFilePath +
531+
path.relative(loaderContext.rootContext,defFilePath) +
532532
'@' +
533533
(
534534
instance.files.get(defFilePath) ||

0 commit comments

Comments
 (0)