rspack icon indicating copy to clipboard operation
rspack copied to clipboard

[Bug]: [fullhash] not works in production mode

Open 9aoy opened this issue 1 year ago • 1 comments

System Info

rspack 0.6.3

Details

Filename "[fullhash]" does not work in production mode, the output filename hash is different from the compilation hash.

However, when I set optimization.realContentHash is false, it works. Seems we should not add contentHash if this chunk is a fullHashModule when createHash.

20240429-200000

Reference webpack:

https://github.com/webpack/webpack/blob/7b4775cebe372f9396d8f3b61ef1347cb633956e/lib/Compilation.js#L4334-L4337

https://github.com/webpack/webpack/blob/ab47c696a403862dbd996f8c2f1ef3770f24ee09/lib/optimize/RealContentHashPlugin.js#L173-L192

Reproduce link

No response

Reproduce Steps

Apply the following configuration in rspack.config.js:

	output: {
		filename: `[name].[fullhash].js`
	},
	optimization: {
		realContentHash: true // or false
	},
	stats: {
		hash: true
	},

9aoy avatar Apr 29 '24 12:04 9aoy

need to align fullhashModules and dependentHashModules on chunk graph and hot module replacment

LingyuCoder avatar Apr 30 '24 09:04 LingyuCoder

This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

stale[bot] avatar Jun 29 '24 13:06 stale[bot]