Skip to content

Commit 870cd11

Browse files
author
Abhijeet Singh
committed
feat: warn if using [contenthash] in filenames in development mode
1 parent 8450da9 commit 870cd11

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/rspack/src/config/defaults.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,17 @@ const applyOutputDefaults = (
544544
futureDefaults: boolean;
545545
}
546546
) => {
547+
// Warn if [contenthash] is used in output.filename in development mode
548+
if (
549+
development &&
550+
typeof output.filename === "string" &&
551+
output.filename.includes("[contenthash]")
552+
) {
553+
console.warn(
554+
"[Rspack] Warning: Using [contenthash] in output.filename in development mode will bloat memory. It is recommended to use [name] or [hash] instead."
555+
);
556+
}
557+
547558
const getLibraryName = (library: Library): string => {
548559
const libraryName =
549560
typeof library === "object" &&

0 commit comments

Comments
 (0)