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
It looks like it is an ordering issue. The code which adds a hook to PROCESS_ASSETS_STAGE_ADDITIONS is called inside a hook to PROCESS_ASSETS_STAGE_REPORT. However, PROCESS_ASSETS_STAGE_ADDITIONS is supposed to occur before PROCESS_ASSETS_STAGE_REPORT. That's one part of the problem.
Another problem is that TerserPlugin (which is used automatically in production mode in webpack 5) moves the banner to the main.js.LICENSE.txt file. I will update the documentation showing how to turn off TerserPlugin's comment handling so that LicenseWebpackPlugin behaves the same way it did in webpack v4.
Minimal reproduction:
package.json
app.js
webpack.config.js
The output file does not contain the banner described in webpack.config.js.
This problem may be caused by a webpack bug, but I'm not a specialist in this matter. A quick fix is to put the banner generating code outside the webpack hook (https://github.com/xz64/license-webpack-plugin/blob/master/src/WebpackCompilerHandler.ts#L154):
The text was updated successfully, but these errors were encountered: