From d0cf6655a6255b57f07a02940c758f4b77e4c2b1 Mon Sep 17 00:00:00 2001 From: Kata Martin Date: Fri, 13 Dec 2024 10:18:35 -0500 Subject: [PATCH] Set up assetPrefix for production fonts --- docs/next.config.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/next.config.js b/docs/next.config.js index 7510410..b455ee2 100644 --- a/docs/next.config.js +++ b/docs/next.config.js @@ -2,6 +2,11 @@ const withMDX = require('@next/mdx')({ extension: /\.mdx?$/, options: { format: 'mdx' }, }) + +const isDev = + process.env.VERCEL_ENV === 'preview' || process.env.NODE_ENV === 'development' + module.exports = withMDX({ pageExtensions: ['js', 'jsx', 'tsx', 'md', 'mdx'], + assetPrefix: isDev ? '' : 'https://charts.docs.carbonplan.org', })