Skip to content

Commit 8c6d3be

Browse files
add explanation why plugins are passed thru a factory
1 parent bad9584 commit 8c6d3be

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/webpack-plugin/src/webpack4and5.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,14 @@ function webpackModuleMetadataInjectionPlugin(
195195
});
196196
}
197197

198+
/**
199+
* The factory function accepts BannerPlugin and DefinePlugin classes in
200+
* order to avoid direct dependencies on webpack.
201+
*
202+
* This allow us to export version of the plugin for webpack 5.1+ and compatible environments.
203+
*
204+
* Since webpack 5.1 compiler contains webpack module so plugins always use correct webpack version.
205+
*/
198206
export function sentryWebpackUnpluginFactory({
199207
BannerPlugin,
200208
DefinePlugin,

0 commit comments

Comments
 (0)