rspack
rspack copied to clipboard
[Bug]: `cacheGroups` filename params with `maxSize` doesn't take effect
System Info
System: All Version: RSPack 0.6.3
Details
I have the following cacheGroups configuration
svg: {
filename: 'svg-[contenthash].js',
name: 'svg',
chunks: 'all',
maxSize: 100 * 1024,
reuseExistingChunk: true,
test: /.*\.svg/,
},
With webpack, I get the following files
* svg-xxxxxx-yyyyyyy.js
* svg-aaaaaa-bbbbb.js
* ...
With RSPack, I get the following files
* svg-1.js
* svg-2.js
* ...
* svg-xxxxxx.js
I would expect [contentHash] to take effect here
Reproduce link
No response
Reproduce Steps
Add a cacheGroups entry, and set max size so multiple chunks are produced
See that [contentHash] is not respected
Actually, no part of the name configuration takes effect
EX:
svg: {
filename: 'svg-helloworld.js',
name: 'svg',
chunks: 'all',
maxSize: 100 * 1024,
reuseExistingChunk: true,
test: /.*\.svg/,
}
Produces
* svg-1.js
* svg-2.js
* ...
* svg-helloworld.js
I could not reproduce this issue. Please provide a minimal reproduction repository. @abettadapur
Thanks for looking @SyMind . I'm on vacation right now, but can provide you a repro next week
@SyMind I'm having trouble creating a repro, but I can still reproduce the issue in my codebase
For more context, I think the issue only occurs in development mode, where RSPack seems to try to use the loader name as part of the chunk name.
For this particular cacheGroup, I am using a custom loader in my configuration, which is producing the above issue, even on v0.7.5
However, even in my repro repository, RSPack seems to use custom-loader in the chunk name, so I'm not sure what's different about my configurations
My attempt at a repro here: https://github.com/abettadapur/rspack-chunk-repro
And just to show you
@SyMind could you point me to where these cache group names are generated? I can try to debug on my end
@abettadapur I will work on this issue this week.
I ran both build and build-webpack in the following repository: abettadapur/rspack-chunk-repro. However, I couldn't identify any differences between Rspack and Webpack.
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!