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
When using SourceMapDevToolPlugin, the produced sourcemaps filename outputs the incorrect hash in the filename template for [contenthash]. It outputs the assets contenthash in this token rather than the sourcemaps contenthash.
This behavior is unexpected and different to behavior within Webpack.
The current RSPack behavior can result in sourcemap files overwriting each other with the same name despite different content - when a underlying source change is only types.
When using the SourceMapDevToolPlugin, it is expected that the [contenthash] in it's configuration of the filename refers to the content hash of the sourcemap.
Webpack explicitly creates the [contenthash] for naming the sourcemap here.
Observe dist/rspack contains only 2 files. Because one is overwritten, due to the entries contenthash being used rather than the sourcemaps content hash, resulting in the pattern:
When using the SourceMapDevToolPlugin, it is expected that the [contenthash] in it's configuration of the filename refers to the content hash of the sourcemap, not the content hash of the entry asset.
The text was updated successfully, but these errors were encountered:
System Info
OS: macOS 13.6.3
CPU: (10) arm64 Apple M1 Pro
Memory: 7.02 GB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.11.0 - ~/.nvm/versions/node/v22.11.0/bin/node
npm: 10.9.0 - ~/.nvm/versions/node/v22.11.0/bin/npm
Browsers:
Chrome: 130.0.6723.117
npmPackages:
@rspack/cli: 1.1.4 => 1.1.4
@rspack/core: 1.1.4 => 1.1.4
Details
When using
SourceMapDevToolPlugin
, the produced sourcemaps filename outputs the incorrect hash in the filename template for[contenthash]
. It outputs the assets contenthash in this token rather than the sourcemaps contenthash.This behavior is unexpected and different to behavior within Webpack.
The current RSPack behavior can result in sourcemap files overwriting each other with the same name despite different content - when a underlying source change is only types.
When using the
SourceMapDevToolPlugin
, it is expected that the[contenthash]
in it's configuration of thefilename
refers to the content hash of the sourcemap.Webpack explicitly creates the
[contenthash]
for naming the sourcemap here.Reproduce link
https://github.com/cblagg/rspack-sourcemap-name-repro
Reproduce Steps
Steps to reproduce:
npm i
ENTRY=untyped npm run build:webpack
ENTRY=typed npm run build:webpack
ENTRY=untyped npm run build
ENTRY=typed npm run build
dist/webpack
contains 3 files. Where the sourcemap files are named with the pattern of:{sourcemaps_content_hash}-{entry_name}-{entry_content_hash}-min.js.map
dist/rspack
contains only 2 files. Because one is overwritten, due to the entries contenthash being used rather than the sourcemaps content hash, resulting in the pattern:{entry_content_hash}-{entry_name}-{entry_content_hash}-min.js.map
When using the
SourceMapDevToolPlugin
, it is expected that the[contenthash]
in it's configuration of thefilename
refers to the content hash of the sourcemap, not the content hash of the entry asset.The text was updated successfully, but these errors were encountered: