-
-
Notifications
You must be signed in to change notification settings - Fork 781
Description
System Info
@rspack/core: 1.0.5
license-webpack-plugin: 4.0.2
Details
The default value for outputFilename in license-webpack-plugin is '[name].licenses.txt';
however, perChunkOutput enabled or not, the '[name]' will not be replaced at all, resulting in
license-webpack-plugin to only generate one [name].licenses.txt[sic] file and just keep overwriting it.
I did some debugging,
rspack/packages/rspack/src/Compilation.ts
Line 889 in 7cddc17
| return this.#inner.getPath(filename, data); |
indeed the compilation object only has a hash property, therefore getPath will only replace [hash] and nothing else;
Webpack 5 does replace [name] though.
Interestingly I also use the built in CssExtractRspackPlugin
plugins: [
...
new rspack.CssExtractRspackPlugin({
filename: './style/[name].min.css',
}),
],
which does replace [name] though; I wonder what's the difference?
Meantime perhaps we should add a note in https://rspack.dev/guide/compatibility/plugin#plugin-compatibility?
Reproduce link
No response
Reproduce Steps
Just add
import { LicenseWebpackPlugin } from 'license-webpack-plugin;
...
plugins: [
...
new LicenseWebpackPlugin(),
],
...
to any rspack config. The output license file would be [name].license.txt[sic].