You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the new experiments.css approach (generator) for css modules generates different hashes to Webpack as can be seen on the below screenshot (left Rspack, right Webpack), this was reproduced by using the https://github.com/rspack-contrib/rspack-examples/tree/main/rspack/css-parser-generator-options example and adding an identical weback.config.js (only changing Rspack imports to Webpack equivalents).
This isn't particularly impacting me, but discovered when trying to generate a mappings json file of the classes using postcss/postcss-modules (our existing solution) and getting different hashes to the ones produced by Rspack. They are also different to the Webpack generated ones too, and am struggling to see how both Rspack and Webpack are generating these hashes (as don't seem to just be a simple md4 hash like you'd be able to regenerate using https://github.com/webpack/loader-utils for example).
Any help understanding how these are generated and/or how I could generate matching mapping files would be appreciated.
Rspack uses output.hashFunction(default: md4) and output.hashDigest(default: hex) to cacluate hash of localNameIdent, just the same as webpack. But there are some bugs here that make the hash result different. I will try to fix this.
System Info
System:
OS: macOS 14.3
CPU: (10) arm64 Apple M1 Pro
Memory: 105.77 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.12.2 - ~/.asdf/installs/nodejs/20.12.2/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 10.5.0 - ~/.asdf/plugins/nodejs/shims/npm
Watchman: 2024.01.22.00 - /opt/homebrew/bin/watchman
Browsers:
Chrome: 124.0.6367.94
Safari: 17.3
npmPackages:
@rspack/cli: latest => 0.6.1
@rspack/core: latest => 0.6.1
Details
Using the new experiments.css approach (generator) for css modules generates different hashes to Webpack as can be seen on the below screenshot (left Rspack, right Webpack), this was reproduced by using the https://github.com/rspack-contrib/rspack-examples/tree/main/rspack/css-parser-generator-options example and adding an identical
weback.config.js
(only changing Rspack imports to Webpack equivalents).This isn't particularly impacting me, but discovered when trying to generate a mappings json file of the classes using
postcss
/postcss-modules
(our existing solution) and getting different hashes to the ones produced by Rspack. They are also different to the Webpack generated ones too, and am struggling to see how both Rspack and Webpack are generating these hashes (as don't seem to just be a simple md4 hash like you'd be able to regenerate using https://github.com/webpack/loader-utils for example).Any help understanding how these are generated and/or how I could generate matching mapping files would be appreciated.
Reproduce link
No response
Reproduce Steps
generator.localIdentName
to[hash]-[local]
(anything containing[hash]
will do)rspack.config.js
aswebpack.config.js
and update the imports (Rspack & HtmlRspackPlugin) to Webpack equivalentsThe text was updated successfully, but these errors were encountered: