Skip to content

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

chore(docs): lodash tree shaking

Greg Richardsoned8798e60c93
diff --git a/apps/docs/generator/helpers.ts b/apps/docs/generator/helpers.ts
index e7796c9101f..30b8037d818 100644
--- a/apps/docs/generator/helpers.ts
+++ b/apps/docs/generator/helpers.ts
@@ -1,5 +1,5 @@
-import * as _ from 'lodash'
import * as fs from 'fs'
+import { mapValues, values } from 'lodash'
export const slugify = (text: string) => {
if (!text) return ''
@@ -34,8 +34,8 @@ export const writeToDisk = (fileName: string, content: any) => {
* Convert Object to Array of values
*/
export const toArrayWithKey = (obj: object, keyAs: string) =>
- _.values(
- _.mapValues(obj, (value: any, key: string) => {
+ values(
+ mapValues(obj, (value: any, key: string) => {
value[keyAs] = key
return value
})
diff --git a/apps/docs/next.config.mjs b/apps/docs/next.config.mjs
index 029a3767707..5f38a0d35c6 100644
--- a/apps/docs/next.config.mjs
+++ b/apps/docs/next.config.mjs
@@ -45,7 +45,7 @@ const withMDX = nextMdx({
},
})
-// /** @type {NextConfig} */
+/** @type {import('next').NextConfig} nextConfig */
const nextConfig = {
// Append the default value with md extensions
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
@@ -64,6 +64,11 @@ const nextConfig = {
},
experimental: {
mdxRs: true,
+ modularizeImports: {
+ lodash: {
+ transform: 'lodash/{{member}}',
+ },
+ },
},
async headers() {
return [