Open bigbossx opened 3 days ago
workaround:
// rsbuild.config.ts
export default defineConfig({
output:{
filenameHash: 'contenthash:16' // long hash name to reduce the probability of conflict
}
})
Yes, we have discussed this issue. Using a content hash of 10 characters or more should avoid this problem, but it will also increase the bundle size slightly.
If Rspack can implement a more secure hash replacement, that will be the best approach.
It might be similar to https://github.com/webpack/webpack/issues/14058.
Duplicate with: https://github.com/web-infra-dev/rspack/issues/5339
just a suggestion:
maybe we can change the default config in rsbuild to
const getHash = () => {
if (typeof filenameHash === 'string') {
return filenameHash ? `.[${filenameHash}]` : '';
}
return filenameHash ? '.[contenthash:12]' : '';
};
and note this warning or tips
in rspack docs
in next release
because it seems like it will take some time to really fix it(webpack too), but before that, we can reduce the probability of bugs happening(we was report by user in production env🥹)
System Info
rsbuild version: 1.0.19
break down in production build
Details
is it stable reproduce ? No, i can't provider a mini reproduce
webpack has some problem?No, only happen with rsbuild
maybe rspack need a better way to replace hash content in chunk, not global replace
please cc @chenjiahan btw, thanks for your quick answer in wechat. help me a lot
Reproduce link
No response
Reproduce Steps
source code was break down in