Yes
Yes
Deployment, static files, hosting
Environment Info:
System:
OS: Linux 4.14 Ubuntu 14.04.5 LTS, Trusty Tahr
CPU: x64 Intel(R) Xeon(R) CPU E5-2666 v3 @ 2.90GHz
Binaries:
Node: 10.14.0 - /usr/bin/node
npm: 6.4.1 - /usr/bin/npm
npmPackages:
react: 16.8.4 => 16.8.4
react-dom: 16.8.4 => 16.8.4
react-scripts: 2.1.8 => 2.1.8
npmGlobalPackages:
create-react-app: Not Found
Based on the docs, I would expect the "contenthash" values on both of my builds to be the same for my main.js, main.css and chunk.js files.
On the 2 different boxes, my app builds successfully, but the hashnames are totally different.
I know this is happening because CodePipeline is bringing my code into a directory that they are creating dynamically. The "hash" is based on the directory that the code is built in.
Clone the CRA base into a local working directory (./cra1 as an example).
Clone it again into another local working directory (./cra2 as an example).
Run npm run build on both folders.
Note the "compiled" filenames are different but their content is the same.
Reproduced just like you said; renaming the directory causes the hashes to change.
Related: https://github.com/webpack/webpack/issues/8419.
Sounds like they are reworking their hashing system for webpack 5.0 that could possibly fix this.
Most helpful comment
Related: https://github.com/webpack/webpack/issues/8419.
Sounds like they are reworking their hashing system for webpack 5.0 that could possibly fix this.