feat: warn if using [contenthash] in filenames in development mode #10521
+11
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Using [contenthash] in filenames in development mode would bloat memory. Added a warning to the console if
[contenthash]
is added to the filename in development mode.Feature request: #9513
Gave a shot at implementing the feature. Please let me know if the warning should be added somewhere else in the codebase or if this needs an accompanying documentation update as well. I'd imagine the warning should go somewhere in the output docs as well: https://rspack.rs/config/output
Update: I noticed that the warning for this is already documented but it's too far down the page in another section and I just happened to stumble across it as I was reading the docs.
IMO it'd be easier to come across this warning if it came earlier in the output.filename docs, right where the usage of contenthash is first suggested:
Let me know, I'll move the warning up in the page if it makes sense.
Checklist