Skip to content

Commit b8ac17f

Browse files
committed
Use next.config.mjs, typecheck
1 parent 39e3d19 commit b8ac17f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
const { randomUUID } = require("node:crypto");
1+
// @ts-check
2+
3+
import { randomUUID } from "node:crypto";
4+
import createNextIntlPlugin from "next-intl/plugin";
25

3-
const createNextIntlPlugin = require("next-intl/plugin");
46
const withNextIntl = createNextIntlPlugin();
57

68
const imageHostname = String(process.env.NEXT_PUBLIC_DRUPAL_BASE_URL).split(
@@ -16,7 +18,7 @@ const nextConfig = {
1618
cacheHandler:
1719
// Only use the cache handler in production
1820
process.env.NODE_ENV === "production"
19-
? require.resolve("./cache-handler.mjs")
21+
? new URL("./cache-handler.mjs", import.meta.url).pathname
2022
: undefined,
2123
cacheMaxMemorySize: 0, // Disable in-memory cache
2224

@@ -37,7 +39,7 @@ const nextConfig = {
3739

3840
async generateBuildId() {
3941
return process.env.CIRCLECI
40-
? process.env.CIRCLE_BUILD_NUM
42+
? String(process.env.CIRCLE_BUILD_NUM)
4143
: randomUUID().split("-")[0];
4244
},
4345

@@ -81,4 +83,4 @@ const nextConfig = {
8183
},
8284
};
8385

84-
module.exports = withNextIntl(nextConfig);
86+
export default withNextIntl(nextConfig);

0 commit comments

Comments
 (0)