Skip to content

Commit

Permalink
chore: setup mdx pages
Browse files Browse the repository at this point in the history
  • Loading branch information
awinogradov committed Aug 8, 2023
1 parent e79ba7c commit e9ccf31
Show file tree
Hide file tree
Showing 5 changed files with 1,647 additions and 171 deletions.
18 changes: 16 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,21 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const { withSentryConfig } = require('@sentry/nextjs');
const path = require('path');
const withMDX = require('@next/mdx')({
extension: /\.mdx?$/,
options: {
// If you use remark-gfm, you'll need to use next.config.mjs
// as the package is ESM only
// https://github.com/remarkjs/remark-gfm#install
remarkPlugins: [],
rehypePlugins: [],
providerImportSource: '@mdx-js/react',
},
});

/** @type {import('next').NextConfig} */
const nextConfig = {
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
reactStrictMode: true,
swcMinify: true,
output: 'standalone',
Expand Down Expand Up @@ -68,10 +80,12 @@ const nextConfig = {
},
};

const configWithPlugins = withMDX(nextConfig);

module.exports =
process.env.ANALYZE === 'true'
? require('@next/bundle-analyzer')({})(nextConfig)
: withSentryConfig(nextConfig, {
? require('@next/bundle-analyzer')({})(configWithPlugins)
: withSentryConfig(configWithPlugins, {
silent: true,
hideSourcemaps: true,
ignore: ['node_modules'],
Expand Down
Loading

0 comments on commit e9ccf31

Please sign in to comment.