Skip to content

[Bug]: Contenthash remains the same when content changes #8431

@cblagg

Description

@cblagg

Details

When using rspack.CssExtractRspackPlugin and configuring file names with [contenthash], the same resulting filename is observed even when the content of the file changes.

This behavior is unexpected, particularly when using realContentHash: true - where I understand it should calculate this hash from the actual content of the file.

Reproduce link

https://github.com/cblagg/rspack-css-contenthash-repro/tree/main

Reproduce Steps

Steps to reproduct:

  1. npm i
  2. Run: CSS_MINIFIER=rspack npm run build
  3. Run: CSS_MINIFIER=webpack npm run build
  4. Observe .css files in each of dist/rspack and dist/webpack have differing content but share the same name

System Info

System:

  • OS: macOS 13.6.3
  • CPU: (10) arm64 Apple M1 Pro
  • Memory: 2.76 GB / 32.00 GB
  • Shell: 5.9 - /bin/zsh

Binaries:

  • Node: 20.15.0 - ~/.nvm/versions/node/v20.15.0/bin/node
  • npm: 10.7.0 - ~/.nvm/versions/node/v20.15.0/bin/npm
  • pnpm: 9.12.2 - ~/.nvm/versions/node/v20.15.0/bin/pnpm

Browsers:

  • Chrome: 130.0.6723.117

npmPackages:

  • @rspack/cli: 1.1.0 => 1.1.0
  • @rspack/core: 1.1.0 => 1.1.0

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpending triageThe issue/PR is currently untouched.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions