From 02ffcfe4291460e2da9ddd9a877b96e66d4bb8f6 Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Mon, 11 Mar 2024 02:07:22 +0900 Subject: [PATCH] fix(web)!: disable mdxRs (#3261) --- apps/web/components/markdown.tsx | 34 -------------------------------- apps/web/mdx-components.tsx | 7 ++----- apps/web/next.config.js | 4 ---- 3 files changed, 2 insertions(+), 43 deletions(-) delete mode 100644 apps/web/components/markdown.tsx diff --git a/apps/web/components/markdown.tsx b/apps/web/components/markdown.tsx deleted file mode 100644 index 851998c60..000000000 --- a/apps/web/components/markdown.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { type MDXComponents } from 'mdx/types' -import NextLink from 'next/link' - -const EXTERNAL_LINK_REL_LIST = ['noopener', 'noreferrer'] as const - -export const MarkdownLink: NonNullable = ({ - href, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - ref: _ref, - rel, - target, - ...props -}) => { - if (!href || /https?:\/\//.test(href)) { - const relList = rel ? rel.split(/\s+/) : [] - - for (const relValue of EXTERNAL_LINK_REL_LIST) { - if (!relList.includes(relValue)) { - relList.push(relValue) - } - } - - return ( - 0 ? relList.join(' ') : undefined} - target={target ?? '_blank'} - {...props} - /> - ) - } - - return -} diff --git a/apps/web/mdx-components.tsx b/apps/web/mdx-components.tsx index 045f3269c..8667898e5 100644 --- a/apps/web/mdx-components.tsx +++ b/apps/web/mdx-components.tsx @@ -1,8 +1,5 @@ import { type MDXComponents } from 'mdx/types' -import { MarkdownLink } from '@/components/markdown' -export function useMDXComponents(): MDXComponents { - return { - a: MarkdownLink - } +export function useMDXComponents(components: MDXComponents): MDXComponents { + return components } diff --git a/apps/web/next.config.js b/apps/web/next.config.js index ccc034197..9bb52dddd 100644 --- a/apps/web/next.config.js +++ b/apps/web/next.config.js @@ -19,9 +19,6 @@ const withMDX = nextMDX({ /** @type {import('next').NextConfig} */ const nextConfig = { - experimental: { - mdxRs: true - }, async headers() { return [ { @@ -59,7 +56,6 @@ const nextConfig = { } ] }, - swcMinify: true, webpack(config, { defaultLoaders }) { config.module.rules.push({ test: /\.svg$/,