From d95227fbefb7f62906304c145b614a580cd0eed6 Mon Sep 17 00:00:00 2001 From: Ely Alvarado Date: Thu, 9 Apr 2020 09:22:10 -0500 Subject: [PATCH 1/2] 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. --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index eccea8ef9..0b34ddd46 100644 --- a/src/index.ts +++ b/src/index.ts @@ -489,7 +489,7 @@ function getEmit( .concat(additionalDependencies) .map( defFilePath => - defFilePath + + path.relative(loaderContext.rootContext,defFilePath) + '@' + (instance.files.get(defFilePath) || { version: '?' }).version ); From e4372fb797a3ef56a20f3f3eb5b0aedf24c5806c Mon Sep 17 00:00:00 2001 From: elyalvarado Date: Tue, 28 Apr 2020 21:18:03 -0500 Subject: [PATCH 2/2] Update Changelog and package.json to v7.0.2 --- CHANGELOG.md | 3 +++ package.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d62da038..6180bebaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## v7.0.2 +* [Make content hash consistent across machines](https://github.com/TypeStrong/ts-loader/pull/1085) - thanks @elyalvarado + ## v7.0.1 * [fix: watch-run](https://github.com/TypeStrong/ts-loader/pull/1083) - thanks @zn4rk diff --git a/package.json b/package.json index 58c92655c..dbb0d1bcf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ts-loader", - "version": "7.0.1", + "version": "7.0.2", "description": "TypeScript loader for webpack", "main": "index.js", "types": "dist",