Skip to content

Commit

Permalink
Convert Next config file to ECMAScript module (#3092)
Browse files Browse the repository at this point in the history
  • Loading branch information
SebiVPS authored Jan 14, 2025
1 parent eb3c1a8 commit 9f69e7b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions demo/site/next.config.js → demo/site/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/* eslint-disable */

// @ts-check
const withBundleAnalyzer = require("@next/bundle-analyzer")({

import nextBundleAnalyzer from "@next/bundle-analyzer";

import cometConfig from "./src/comet-config.json" with { type: "json" };

const withBundleAnalyzer = nextBundleAnalyzer({
enabled: process.env.ANALYZE === "true",
});

const cometConfig = require("./src/comet-config.json");

/**
* @type {import('next').NextConfig}
**/
Expand All @@ -26,8 +27,8 @@ const nextConfig = {
experimental: {
optimizePackageImports: ["@comet/cms-site"],
},
cacheHandler: process.env.REDIS_ENABLED === "true" ? require.resolve("./dist/cache-handler.js") : undefined,
cacheHandler: process.env.REDIS_ENABLED === "true" ? import.meta.resolve("./dist/cache-handler.js").replace("file://", "") : undefined,
cacheMaxMemorySize: process.env.REDIS_ENABLED === "true" ? 0 : undefined, // disable default in-memory caching
};

module.exports = withBundleAnalyzer(nextConfig);
export default withBundleAnalyzer(nextConfig);

0 comments on commit 9f69e7b

Please sign in to comment.