From 1563f59f1b3fc66367f93f29702591956359a3cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E7=88=B1=E5=90=83=E7=99=BD=E8=90=9D?= =?UTF-8?q?=E5=8D=9C?= Date: Tue, 2 Sep 2025 17:54:04 +0800 Subject: [PATCH] chore: adjust site config (#54844) --- .dumi/theme/layouts/GlobalLayout.tsx | 10 ---------- .dumirc.ts | 19 ++++++++++++------- .gitignore | 1 + package.json | 1 - 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/.dumi/theme/layouts/GlobalLayout.tsx b/.dumi/theme/layouts/GlobalLayout.tsx index 3246ae5cde..3195dd9499 100644 --- a/.dumi/theme/layouts/GlobalLayout.tsx +++ b/.dumi/theme/layouts/GlobalLayout.tsx @@ -1,6 +1,3 @@ -// prettier-ignore -import { scan } from 'react-scan'; // import this BEFORE react - import React, { useCallback, useEffect } from 'react'; import { createCache, @@ -44,13 +41,6 @@ if (typeof window !== 'undefined') { location.hash = `#${hashId.replace(/^components-/, '')}`; } } - - if (process.env.NODE_ENV !== 'production') { - scan({ - enabled: false, - showToolbar: true, - }); - } } const getAlgorithm = (themes: ThemeName[] = []) => diff --git a/.dumirc.ts b/.dumirc.ts index 5b9957f2f0..c61a52ac59 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -1,12 +1,12 @@ +import os from 'node:os'; import path from 'path'; import { defineConfig } from 'dumi'; import * as fs from 'fs-extra'; -import os from 'node:os'; import rehypeAntd from './.dumi/rehypeAntd'; import rehypeChangelog from './.dumi/rehypeChangelog'; -import remarkAntd from './.dumi/remarkAntd'; import remarkAnchor from './.dumi/remarkAnchor'; +import remarkAntd from './.dumi/remarkAntd'; import { version } from './package.json'; export default defineConfig({ @@ -193,9 +193,14 @@ export default defineConfig({ .readFileSync(path.join(__dirname, '.dumi', 'scripts', 'mirror-notify.js')) .toString(), }, - { - async: true, - content: fs.readFileSync(path.join(__dirname, '.dumi', 'scripts', 'clarity.js')).toString(), - }, - ], + // Only enable clarity in production environment + process.env.NODE_ENV === 'production' + ? { + async: true, + content: fs + .readFileSync(path.join(__dirname, '.dumi', 'scripts', 'clarity.js')) + .toString(), + } + : null, + ].filter((script) => !!script), }); diff --git a/.gitignore b/.gitignore index 2dd7290fd2..abacdfb11e 100644 --- a/.gitignore +++ b/.gitignore @@ -77,3 +77,4 @@ __image_snapshots__/ .env examples/ +components/style/antd.css diff --git a/package.json b/package.json index 0f21f7e707..4f58bd4c91 100644 --- a/package.json +++ b/package.json @@ -307,7 +307,6 @@ "react-intersection-observer": "^9.13.1", "react-resizable": "^3.0.5", "react-router-dom": "^7.0.1", - "react-scan": "^0.4.2", "react-sticky-box": "^2.0.5", "regenerator-runtime": "^0.14.1", "rehype-stringify": "^10.0.1",