Skip to content

Commit a22ebfc

Browse files
Slashgearclaude
andcommitted
chore: modernize Next.js 16 config
- Convert next.config.js to next.config.ts (ESM + proper typing) - Migrate middleware.ts to proxy.ts (deprecated in Next 16) - Remove --turbopack flag from dev script (default in Next 16) - Remove dead next export script (removed since Next 13) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 71337cb commit a22ebfc

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

next.config.js renamed to next.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const withMDX = require('@next/mdx')();
1+
import type { NextConfig } from 'next';
2+
import withMDX from '@next/mdx';
23

3-
/** @type {import('next').NextConfig} */
4-
const nextConfig = {
4+
const nextConfig: NextConfig = {
55
output: 'standalone',
66
experimental: {
77
mdxRs: true,
@@ -73,4 +73,4 @@ const nextConfig = {
7373
},
7474
};
7575

76-
module.exports = withMDX(nextConfig);
76+
export default withMDX()(nextConfig);

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
6-
"dev": "next dev --turbopack",
6+
"dev": "next dev",
77
"build": "next build",
88
"start": "next start",
9-
"export": "next export",
109
"lint": "oxlint",
1110
"fmt": "oxfmt --write .",
1211
"fmt:check": "oxfmt --check .",

middleware.ts renamed to proxy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { NextRequest, NextResponse } from 'next/server';
22

33
const IS_PROD_ENV = process.env.DEPLOY_ENV === 'production' || process.env.DEPLOY_ENV === 'preview';
44

5-
export function middleware(request: NextRequest) {
5+
export function proxy(request: NextRequest) {
66
const nonce = Buffer.from(crypto.randomUUID()).toString('base64');
77
const cspHeader = `
88
default-src 'none';

0 commit comments

Comments
 (0)