chore: adjust site config (#54844)

This commit is contained in:
二货爱吃白萝卜
2025-09-02 17:54:04 +08:00
committed by GitHub
parent a1836c4ec6
commit 1563f59f1b
4 changed files with 13 additions and 18 deletions

View File

@@ -1,6 +1,3 @@
// prettier-ignore
import { scan } from 'react-scan'; // import this BEFORE react
import React, { useCallback, useEffect } from 'react'; import React, { useCallback, useEffect } from 'react';
import { import {
createCache, createCache,
@@ -44,13 +41,6 @@ if (typeof window !== 'undefined') {
location.hash = `#${hashId.replace(/^components-/, '')}`; location.hash = `#${hashId.replace(/^components-/, '')}`;
} }
} }
if (process.env.NODE_ENV !== 'production') {
scan({
enabled: false,
showToolbar: true,
});
}
} }
const getAlgorithm = (themes: ThemeName[] = []) => const getAlgorithm = (themes: ThemeName[] = []) =>

View File

@@ -1,12 +1,12 @@
import os from 'node:os';
import path from 'path'; import path from 'path';
import { defineConfig } from 'dumi'; import { defineConfig } from 'dumi';
import * as fs from 'fs-extra'; import * as fs from 'fs-extra';
import os from 'node:os';
import rehypeAntd from './.dumi/rehypeAntd'; import rehypeAntd from './.dumi/rehypeAntd';
import rehypeChangelog from './.dumi/rehypeChangelog'; import rehypeChangelog from './.dumi/rehypeChangelog';
import remarkAntd from './.dumi/remarkAntd';
import remarkAnchor from './.dumi/remarkAnchor'; import remarkAnchor from './.dumi/remarkAnchor';
import remarkAntd from './.dumi/remarkAntd';
import { version } from './package.json'; import { version } from './package.json';
export default defineConfig({ export default defineConfig({
@@ -193,9 +193,14 @@ export default defineConfig({
.readFileSync(path.join(__dirname, '.dumi', 'scripts', 'mirror-notify.js')) .readFileSync(path.join(__dirname, '.dumi', 'scripts', 'mirror-notify.js'))
.toString(), .toString(),
}, },
{ // Only enable clarity in production environment
async: true, process.env.NODE_ENV === 'production'
content: fs.readFileSync(path.join(__dirname, '.dumi', 'scripts', 'clarity.js')).toString(), ? {
}, async: true,
], content: fs
.readFileSync(path.join(__dirname, '.dumi', 'scripts', 'clarity.js'))
.toString(),
}
: null,
].filter((script) => !!script),
}); });

1
.gitignore vendored
View File

@@ -77,3 +77,4 @@ __image_snapshots__/
.env .env
examples/ examples/
components/style/antd.css

View File

@@ -307,7 +307,6 @@
"react-intersection-observer": "^9.13.1", "react-intersection-observer": "^9.13.1",
"react-resizable": "^3.0.5", "react-resizable": "^3.0.5",
"react-router-dom": "^7.0.1", "react-router-dom": "^7.0.1",
"react-scan": "^0.4.2",
"react-sticky-box": "^2.0.5", "react-sticky-box": "^2.0.5",
"regenerator-runtime": "^0.14.1", "regenerator-runtime": "^0.14.1",
"rehype-stringify": "^10.0.1", "rehype-stringify": "^10.0.1",