浏览代码

Update next.config.js

Aykut Saraç 2 年之前
父节点
当前提交
0126cd37e8
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. 6 3
      next.config.js

+ 6 - 3
next.config.js

@@ -1,6 +1,9 @@
-const withBundleAnalyzer = require("@next/bundle-analyzer")({
-  enabled: process.env.ANALYZE === "true",
-});
+const withBundleAnalyzer =
+  process.env.ANALYZE === "true"
+    ? require("@next/bundle-analyzer")({
+        enabled: process.env.ANALYZE === "true",
+      })()
+    : x => x;
 
 /**
  * @type {import('next').NextConfig}