Description
Version
3.0.5
Reproduction link
https://github.com/zhangbobell/vue-cli-content-hash-reproduce
Node and OS info
Node v8.11.2 / yarn 1.10.1 / macOS 10.14 (18A391)
Steps to reproduce
Do the following 4 steps in two machines or in one machine different path, compare the content-hash in dist/js/app.<content-hash>.js
, you will find them not the same.
git clone https://github.com/zhangbobell/vue-cli-content-hash-reproduce.git
cd vue-cli-content-hash-reproduce
yarn
NODE_ENV=production yarn build
I've test in two machines, the result shows below:
Result on machine A (app.js content-hash is efe1aa10
):
Result on machine B (app.js content-hash is d9410857
):
What is expected?
The two content-hash of app.js
on two machines will be the same.
What is actually happening?
They are different
The following is my Vue-Cli settings:
I have debug this for some hours, but did not have any valuable result. But I'm sure it has something to do with babel-polyfill, since the difference disappears when I choose No with Use Babel alongside TypeScript for auto-detected polyfills? (Y/n)
prompt.
It seems that babel-polyfill will inject absolute path into the compiled js, that lead this bug.
I wish someone could help to debug this.
Thanks for providing a awesome tool !