Skip to content

Commit 8c14b3e

Browse files
committed
fix next config file
1 parent c781f7a commit 8c14b3e

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

next.config.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* eslint-disable @typescript-eslint/no-var-requires */
22
const { PHASE_DEVELOPMENT_SERVER } = require("next/constants")
33
const { withSentryConfig } = require("@sentry/nextjs")
4-
const webpack = require("webpack")
54

65
const withBundleAnalyzer = require("@next/bundle-analyzer")({
76
enabled: process.env.ANALYZE === "true",
@@ -28,7 +27,7 @@ module.exports = (phase, { defaultConfig }) => {
2827
let nextConfig = {
2928
...defaultConfig,
3029
reactStrictMode: true,
31-
webpack: (config) => {
30+
webpack: (config, { webpack }) => {
3231
config.module.rules.push({
3332
test: /\.ya?ml$/,
3433
use: "yaml-loader",
@@ -38,18 +37,19 @@ module.exports = (phase, { defaultConfig }) => {
3837
use: "@svgr/webpack",
3938
})
4039

41-
return config
42-
},
43-
plugins: [
4440
// Tree shake Sentry debug code
4541
// 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+
},
5353
i18n,
5454
trailingSlash: true,
5555
images: {

0 commit comments

Comments
 (0)