Skip to content

Commit 629ab2a

Browse files
authored
docs(plugins): add stage option for BannerPlugin (#7196)
1 parent 1e062d9 commit 629ab2a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/content/plugins/banner-plugin.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ contributors:
55
- simon04
66
- byzyk
77
- chenxsan
8+
- snitin315
89
related:
910
- title: banner-plugin-hashing test
1011
url: https://github.com/webpack/webpack/blob/main/test/configCases/plugins/banner-plugin-hashing/webpack.config.js
@@ -31,6 +32,7 @@ new webpack.BannerPlugin(options);
3132
include: string | RegExp | [string, RegExp], // Include all modules matching any of these conditions.
3233
exclude: string | RegExp | [string, RegExp], // Exclude all modules matching any of these conditions.
3334
footer?: boolean, // if true, the banner will be placed at the end of the compilation
35+
stage?: number, // the stage of the compilation in which the banner should be injected
3436
}
3537
```
3638
@@ -50,6 +52,13 @@ new webpack.BannerPlugin({
5052
return `yourVariable: ${yourVariable}`;
5153
},
5254
});
55+
56+
// It will add the banner message after minimizers and any asset manipulation
57+
new webpack.BannerPlugin({
58+
raw: true,
59+
banner: '/* banner is a string */',
60+
stage: webpack.Compilation.PROCESS_ASSETS_STAGE_REPORT,
61+
});
5362
```
5463
5564
## Placeholders

0 commit comments

Comments
 (0)