From d5001c9ee5467aedb00f9520f69c774bc7e9c943 Mon Sep 17 00:00:00 2001 From: Strtus Date: Tue, 19 May 2026 00:40:34 +0800 Subject: [PATCH] Use default export in Next config for EdgeOne compatibility Switch next.config.ts from CommonJS export to default export so OpenNext wrappers can import the original config during type checking. Co-authored-by: Cursor --- next.config.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/next.config.ts b/next.config.ts index 389a8b7b..53dc488e 100644 --- a/next.config.ts +++ b/next.config.ts @@ -2,6 +2,7 @@ import { removeUrlProtocol } from '@/utility/url'; import type { NextConfig } from 'next'; import { RemotePattern } from 'next/dist/shared/lib/image-config'; import path from 'path'; +import bundleAnalyzer from '@next/bundle-analyzer'; const VERCEL_BLOB_STORE_ID = process.env.BLOB_READ_WRITE_TOKEN?.match( /^vercel_blob_rw_([a-z0-9]+)_[a-z0-9]+$/i, @@ -96,6 +97,8 @@ const nextConfig: NextConfig = { }, }; -module.exports = process.env.ANALYZE === 'true' - ? require('@next/bundle-analyzer')()(nextConfig) - : nextConfig; +const withBundleAnalyzer = bundleAnalyzer({ + enabled: process.env.ANALYZE === 'true', +}); + +export default withBundleAnalyzer(nextConfig);