From 5804c2ff5c200857d12856277b6edd8c24997d2c Mon Sep 17 00:00:00 2001 From: Rotimi Best Date: Fri, 16 Feb 2024 21:11:12 +0100 Subject: [PATCH] feat: add million to docs (#169) --- apps/docs/next.config.js | 10 +++++++++- apps/docs/package.json | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/docs/next.config.js b/apps/docs/next.config.js index 9f1c0c64..4414fa1b 100644 --- a/apps/docs/next.config.js +++ b/apps/docs/next.config.js @@ -1,3 +1,5 @@ +const million = require('million/compiler'); + const env = process.env.NODE_ENV; const withNextra = require('nextra')({ @@ -5,7 +7,7 @@ const withNextra = require('nextra')({ themeConfig: './theme.config.tsx' }); -module.exports = { +const nextConfig = { basePath: env === 'production' ? '/docs' : undefined, env: { imagePath: env === 'production' ? '/docs' : '' @@ -15,3 +17,9 @@ module.exports = { }, ...withNextra() }; + +const millionConfig = { + auto: true +}; + +module.exports = million.next(nextConfig, millionConfig); diff --git a/apps/docs/package.json b/apps/docs/package.json index 41c83a78..d182b575 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -18,6 +18,7 @@ }, "homepage": "https://github.com/shuding/nextra-docs-template#readme", "dependencies": { + "million": "^3.0.3", "next": "^13.0.6", "nextra": "latest", "nextra-theme-docs": "latest",