1
1
import type { GLOBAL_OBJ } from '@sentry/utils' ;
2
2
import 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 } ;
10
3
11
4
// The first argument to `withSentryConfig` (which is the user's next config).
12
5
export type ExportedNextConfig = NextConfigObject | NextConfigFunction ;
@@ -17,6 +10,11 @@ type NextRewrite = {
17
10
destination : string ;
18
11
} ;
19
12
13
+ interface WebpackPluginInstance {
14
+ [ index : string ] : any ;
15
+ apply : ( compiler : any ) => void ;
16
+ }
17
+
20
18
export type NextConfigObject = {
21
19
// Custom webpack options
22
20
webpack ?: WebpackConfigFunction | null ;
@@ -502,7 +500,7 @@ export type BuildContext = {
502
500
config : any ;
503
501
webpack : {
504
502
version : string ;
505
- DefinePlugin : typeof DefinePlugin ;
503
+ DefinePlugin : new ( values : Record < string , string | boolean > ) => WebpackPluginInstance ;
506
504
} ;
507
505
// eslint-disable-next-line @typescript-eslint/no-explicit-any
508
506
defaultLoaders : any ; // needed for type tests (test:types)
0 commit comments