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 <cursoragent@cursor.com>
This commit is contained in:
Strtus 2026-05-19 00:40:34 +08:00
parent 2c630ebd50
commit d5001c9ee5

View File

@ -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);