1
1
/* eslint-disable @typescript-eslint/no-var-requires */
2
2
const { PHASE_DEVELOPMENT_SERVER } = require ( "next/constants" )
3
3
const { withSentryConfig } = require ( "@sentry/nextjs" )
4
- const webpack = require ( "webpack" )
5
4
6
5
const withBundleAnalyzer = require ( "@next/bundle-analyzer" ) ( {
7
6
enabled : process . env . ANALYZE === "true" ,
@@ -28,7 +27,7 @@ module.exports = (phase, { defaultConfig }) => {
28
27
let nextConfig = {
29
28
...defaultConfig ,
30
29
reactStrictMode : true ,
31
- webpack : ( config ) => {
30
+ webpack : ( config , { webpack } ) => {
32
31
config . module . rules . push ( {
33
32
test : / \. y a ? m l $ / ,
34
33
use : "yaml-loader" ,
@@ -38,18 +37,19 @@ module.exports = (phase, { defaultConfig }) => {
38
37
use : "@svgr/webpack" ,
39
38
} )
40
39
41
- return config
42
- } ,
43
- plugins : [
44
40
// Tree shake Sentry debug code
45
41
// ref. https://docs.sentry.io/platforms/javascript/guides/nextjs/configuration/tree-shaking/#tree-shaking-with-nextjs
46
- new webpack . DefinePlugin ( {
47
- __SENTRY_DEBUG__ : false ,
48
- __RRWEB_EXCLUDE_IFRAME__ : true ,
49
- __RRWEB_EXCLUDE_SHADOW_DOM__ : true ,
50
- __SENTRY_EXCLUDE_REPLAY_WORKER__ : true ,
51
- } ) ,
52
- ] ,
42
+ config . plugins . push (
43
+ new webpack . DefinePlugin ( {
44
+ __SENTRY_DEBUG__ : false ,
45
+ __RRWEB_EXCLUDE_IFRAME__ : true ,
46
+ __RRWEB_EXCLUDE_SHADOW_DOM__ : true ,
47
+ __SENTRY_EXCLUDE_REPLAY_WORKER__ : true ,
48
+ } )
49
+ )
50
+
51
+ return config
52
+ } ,
53
53
i18n,
54
54
trailingSlash : true ,
55
55
images : {
0 commit comments