-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vite 打包后所有 js 文件(无论是否修改) hash 都改变了,怎么实现只有改动文件的 hash 值变化。其他文件才能缓存 #6928
Comments
遇到了同样问题,导致文件缓存也失效,请问应该怎么解决 |
是的,像我只改了403文件,预期是只想要403.1891d439.js的hash发生变化,但是现在却是全部js文件的hash发生了改变。查看打包出来的文件内容,发现 引用了403文件的index.056b260d.js内容也发生变化,然后其他文件又引用了这个index.056b260d.js,然后就这样引起了一连串变化 |
@poyoho Did you modify the files in the second build |
maybe this is right? @Krryxa |
@Krryxa I mean the reason for answering this issue 😂 I tested and modified the file to meet expectations |
now had two file index.789123.js import { a } from "./a.123456.js";
console.log("baz" + a); a.123456.js const a=1;
export{a}; If I change I can't reproduce the problem from your repo. Can you provide a more detailed reproduction path? |
@poyoho We already know that this is the reason why the hash values change. We're just looking for a way to avoid this problem. Unmodified files do not change the hash in order to cache them |
@Krryxa |
Closing as this is a duplicate of #6773. |
Describe the bug
vite 打包后所有 js 文件(无论是否修改) hash 都改变了,怎么实现只有改动文件的 hash 值变化。其他文件才能缓存
Reproduction
https://github.com/Krryxa/krry-vue-vite
System Info
Used Package Manager
yarn
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: