Skip to content

Commit b38145b

Browse files
committed
Upgrade to latest nextjs.
1 parent eba523c commit b38145b

File tree

7 files changed

+47
-94
lines changed

7 files changed

+47
-94
lines changed

next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
/// <reference path="./.next/types/routes.d.ts" />
3+
import "./.next/types/routes.d.ts";
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

next.config.js renamed to next.config.mjs

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* @type {import('next').NextConfig}
3+
*/
4+
15
const securityHeaders = [
26
{
37
key: "X-DNS-Prefetch-Control",
@@ -38,19 +42,7 @@ const apiSecurityHeaders = [
3842
},
3943
]
4044

41-
// const withBundleAnalyzer = require("@next/bundle-analyzer")({
42-
// enabled: true,
43-
// })
44-
45-
const withPWA = require("@ducanh2912/next-pwa").default({
46-
disable: process.env.NODE_ENV === "development",
47-
register: false,
48-
dest: "public",
49-
publicExcludes: ["!**/*.mp4", "!**/*.mp3", "!**/*.png"],
50-
})
51-
52-
module.exports = withPWA({
53-
//placeholder_for_static_generation
45+
const nextConfig = {
5446
async headers() {
5547
return [
5648
{
@@ -63,7 +55,15 @@ module.exports = withPWA({
6355
},
6456
]
6557
},
66-
webpack: (config, { isServer }) => {
58+
turbopack: {
59+
resolveAlias: {
60+
// You may need to investigate the exact alias for 'tls' or other fallbacks
61+
// as the Turbopack documentation emphasizes aliasing, not general fallbacks.
62+
// Often, core modules that are only needed on the server are automatically
63+
// stripped from the client bundle.
64+
},
65+
},
66+
turbopack: (config, { isServer }) => {
6767
if (!isServer) {
6868
config.resolve.fallback = {
6969
// Disable the 'tls' module on the client side
@@ -72,4 +72,6 @@ module.exports = withPWA({
7272
}
7373
return config
7474
},
75-
})
75+
}
76+
77+
export default nextConfig

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"private": true,
3+
34
"scripts": {
45
"dev": "source .env.local && next dev",
56
"build": "next build",

src/app/sitemap.test.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/app/sitemap.ts

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/instrumentation.ts

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
/* eslint-disable @typescript-eslint/no-require-imports */
2-
export function register() {
3-
if (process.env.NEXT_RUNTIME === "nodejs") {
4-
const { NodeSDK } = require("@opentelemetry/sdk-node")
5-
const {
6-
getNodeAutoInstrumentations,
7-
} = require("@opentelemetry/auto-instrumentations-node")
8-
const {
9-
OTLPTraceExporter,
10-
} = require("@opentelemetry/exporter-trace-otlp-http")
1+
// /* eslint-disable @typescript-eslint/no-require-imports */
2+
// export function register() {
3+
// if (process.env.NEXT_RUNTIME === "nodejs") {
4+
// const { NodeSDK } = require("@opentelemetry/sdk-node")
5+
// const {
6+
// getNodeAutoInstrumentations,
7+
// } = require("@opentelemetry/auto-instrumentations-node")
8+
// const {
9+
// OTLPTraceExporter,
10+
// } = require("@opentelemetry/exporter-trace-otlp-http")
1111

12-
const sdk = new NodeSDK({
13-
serviceName: "api",
14-
traceExporter: new OTLPTraceExporter({
15-
url: "https://api.axiom.co/v1/traces",
16-
headers: {
17-
Authorization: `Bearer ${process.env.AXIOM_API_TOKEN}`,
18-
"X-Axiom-Dataset": `${process.env.AXIOM_DATASET_NAME}`,
19-
},
20-
}),
21-
instrumentations: [getNodeAutoInstrumentations()],
22-
})
12+
// const sdk = new NodeSDK({
13+
// serviceName: "api",
14+
// traceExporter: new OTLPTraceExporter({
15+
// url: "https://api.axiom.co/v1/traces",
16+
// headers: {
17+
// Authorization: `Bearer ${process.env.AXIOM_API_TOKEN}`,
18+
// "X-Axiom-Dataset": `${process.env.AXIOM_DATASET_NAME}`,
19+
// },
20+
// }),
21+
// instrumentations: [getNodeAutoInstrumentations()],
22+
// })
2323

24-
sdk.start()
25-
}
26-
}
24+
// sdk.start()
25+
// }
26+
// }

tsconfig.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"moduleResolution": "bundler",
1717
"resolveJsonModule": true,
1818
"isolatedModules": true,
19-
"jsx": "preserve",
19+
"jsx": "react-jsx",
2020
"incremental": true,
2121
"baseUrl": ".",
2222
"paths": {
@@ -42,9 +42,10 @@
4242
"**/*.tsx",
4343
"types.d.ts",
4444
"playwright.config.js",
45-
".next/types/**/*.ts"
45+
".next/types/**/*.ts",
46+
".next/dev/types/**/*.ts"
4647
],
4748
"exclude": [
4849
"node_modules"
4950
]
50-
}
51+
}

0 commit comments

Comments
 (0)