Skip to content

Commit

Permalink
Profiling load times
Browse files Browse the repository at this point in the history
  • Loading branch information
skunichetty committed Aug 20, 2024
1 parent 840c78d commit 9b33494
Show file tree
Hide file tree
Showing 3 changed files with 203 additions and 1 deletion.
10 changes: 9 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ import remarkToc from "remark-toc";
import rehypeKatex from "rehype-katex";
import rehypeSlug from "rehype-slug";
import rehypeStarryNight from 'rehype-starry-night'
import NextBundleAnalyzer from "@next/bundle-analyzer";

/** @type {import('next').NextConfig} */
const nextConfig = {
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
output: "export",
images: { unoptimized: true },
experimental: {
optimizePackageImports: ['katex'],
},
};

function remarkMdxFrontmatterWithOptions() {
Expand Down Expand Up @@ -44,5 +48,9 @@ const withMDX = createMDX({
},
});

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

// Wrap MDX and Next.js config with each other
export default withMDX(nextConfig);
export default withBundleAnalyzer(withMDX(nextConfig));
193 changes: 193 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"remark-toc": "^9.0.0"
},
"devDependencies": {
"@next/bundle-analyzer": "^14.2.5",
"@types/katex": "^0.16.7",
"@types/node": "^20",
"@types/react": "^18",
Expand Down

0 comments on commit 9b33494

Please sign in to comment.