Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Update next.config.mjs

Jonathan Summers-Muird28d9b2c4eda
diff --git a/apps/temp-docs/next.config.mjs b/apps/temp-docs/next.config.mjs
index d022cf9b4b2..bb89bccd703 100644
--- a/apps/temp-docs/next.config.mjs
+++ b/apps/temp-docs/next.config.mjs
@@ -5,7 +5,10 @@ import remarkGfm from 'remark-gfm'
import rehypeSlug from 'rehype-slug'
import withTM from 'next-transpile-modules'
-import withPlugins from 'next-compose-plugins'
+
+// import { remarkCodeHike } from '@code-hike/mdx'
+// import theme from 'shiki/themes/dark-plus.json' assert { type: 'json' }
+// import codeHikeTheme from './codeHikeTheme.js'
/**
* Rewrites and redirects are handled by
@@ -14,26 +17,39 @@ import withPlugins from 'next-compose-plugins'
* Do not add them in this config
*/
-// /** @type {NextConfig} */
-const nextConfig = {
- // Append the default value with md extensions
- pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
- reactStrictMode: true,
- swcMinify: true,
-}
-
-const withBundleAnalyzer = bundleAnalyzer({ enabled: process.env.ANALYZE === 'true' })
-
const withMDX = nextMdx({
extension: /\.mdx?$/,
options: {
- remarkPlugins: [remarkGfm],
+ remarkPlugins: [
+ // [
+ // remarkCodeHike,
+ // {
+ // theme: codeHikeTheme,
+ // autoImport: false,
+ // },
+ // ],
+ remarkGfm,
+ ],
rehypePlugins: [rehypeSlug],
+ // This is required for `MDXProvider` component
providerImportSource: '@mdx-js/react',
},
})
-export default withPlugins(
- [[withBundleAnalyzer({})], withMDX(), withTM(['ui', 'common'])],
- nextConfig
-)
+const withBundleAnalyzer = bundleAnalyzer({
+ enabled: process.env.ANALYZE === 'true',
+})
+
+// /** @type {NextConfig} */
+const nextConfig = {
+ // Append the default value with md extensions
+ pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
+ reactStrictMode: true,
+ swcMinify: true,
+}
+
+// next.config.js
+export default () => {
+ const plugins = [withMDX, withTM(['ui', 'common'])]
+ return plugins.reduce((acc, next) => next(acc), nextConfig)
+}