fix(guide): Treeshake react-icons (#9381)

This commit is contained in:
Jiralite 2023-04-13 21:09:40 +01:00 committed by GitHub
parent 66dc4014fe
commit 2a684361d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 22 deletions

View file

@ -58,7 +58,6 @@
"react": "^18.2.0",
"react-custom-scrollbars-2": "^4.5.0",
"react-dom": "^18.2.0",
"react-icons": "^4.8.0",
"react-use": "^17.4.0",
"rehype-autolink-headings": "^6.1.1",
"rehype-ignore": "^1.0.5",

View file

@ -1,4 +1,4 @@
import { FiExternalLink } from 'react-icons/fi';
import { FiExternalLink } from '@react-icons/all-files/fi/FiExternalLink';
import { BASE_URL, BASE_URL_LEGACY, PACKAGES, VERSION } from '~/util/constants';
interface DocsLinkOptions {
@ -61,6 +61,7 @@ export function DocsLink({
if (trimmedSymbol) url += `?scrollTo=${trimmedSymbol}`;
text = `${parent}${trimmedSymbol ? (trimmedSymbol.startsWith('s-') ? '.' : '#') : ''}${
// eslint-disable-next-line prefer-named-capture-group
trimmedSymbol ? `${trimmedSymbol.replace(/(e|s)-/, '')}` : ''
}${bracketText}`;
} else {

View file

@ -1,10 +0,0 @@
import { FiExternalLink } from 'react-icons/fi';
export function ExternalLink({ href, title }: { href: string; title: string }) {
return (
<a className="inline-flex place-items-center gap-2 text-sm font-semibold text-blurple" href={href}>
<p>{title}</p>
<FiExternalLink size={18} />
</a>
);
}

View file

@ -2225,7 +2225,6 @@ __metadata:
react: ^18.2.0
react-custom-scrollbars-2: ^4.5.0
react-dom: ^18.2.0
react-icons: ^4.8.0
react-use: ^17.4.0
rehype-autolink-headings: ^6.1.1
rehype-ignore: ^1.0.5
@ -21170,15 +21169,6 @@ __metadata:
languageName: node
linkType: hard
"react-icons@npm:^4.8.0":
version: 4.8.0
resolution: "react-icons@npm:4.8.0"
peerDependencies:
react: "*"
checksum: 4dbba7ad989c295b410e19b2a702722dae44368cb04b6515f9471353552f31ac80bd350f121d5bff79f81504b84039ede44d09e9f035f48bb1032e6eace126c4
languageName: node
linkType: hard
"react-inspector@npm:^6.0.0":
version: 6.0.1
resolution: "react-inspector@npm:6.0.1"