11import type { GLOBAL_OBJ } from '@sentry/utils' ;
22import type { SentryWebpackPluginOptions } from '@sentry/webpack-plugin' ;
3- import type { DefinePlugin , WebpackPluginInstance } from 'webpack' ;
4-
5- // Export this from here because importing something from Webpack (the library) in `webpack.ts` confuses the heck out of
6- // madge, which we use for circular dependency checking. We've manually excluded this file from the check (which is
7- // safe, since it only includes types), so we can import it here without causing madge to fail. See
8- // https://github.com/pahen/madge/issues/306.
9- export type { WebpackPluginInstance } ;
103
114// The first argument to `withSentryConfig` (which is the user's next config).
125export type ExportedNextConfig = NextConfigObject | NextConfigFunction ;
@@ -17,6 +10,11 @@ type NextRewrite = {
1710 destination : string ;
1811} ;
1912
13+ interface WebpackPluginInstance {
14+ [ index : string ] : any ;
15+ apply : ( compiler : any ) => void ;
16+ }
17+
2018export type NextConfigObject = {
2119 // Custom webpack options
2220 webpack ?: WebpackConfigFunction | null ;
@@ -502,7 +500,7 @@ export type BuildContext = {
502500 config : any ;
503501 webpack : {
504502 version : string ;
505- DefinePlugin : typeof DefinePlugin ;
503+ DefinePlugin : new ( values : Record < string , string | boolean > ) => WebpackPluginInstance ;
506504 } ;
507505 // eslint-disable-next-line @typescript-eslint/no-explicit-any
508506 defaultLoaders : any ; // needed for type tests (test:types)
0 commit comments