diff --git a/.changeset/eleven-apples-accept.md b/.changeset/eleven-apples-accept.md new file mode 100644 index 0000000000..f46bf4fe0c --- /dev/null +++ b/.changeset/eleven-apples-accept.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-components': patch +--- + +Deep-import LightAsync component to improve module-import speed diff --git a/packages/core-components/src/components/CodeSnippet/CodeSnippet.tsx b/packages/core-components/src/components/CodeSnippet/CodeSnippet.tsx index 0e4b12defc..fd83797a88 100644 --- a/packages/core-components/src/components/CodeSnippet/CodeSnippet.tsx +++ b/packages/core-components/src/components/CodeSnippet/CodeSnippet.tsx @@ -18,7 +18,8 @@ import React from 'react'; import { useTheme } from '@material-ui/core/styles'; import { BackstageTheme } from '@backstage/theme'; import { CopyTextButton } from '../CopyTextButton'; -import { LightAsync } from 'react-syntax-highlighter'; +import type {} from 'react-syntax-highlighter'; +import { default as LightAsync } from 'react-syntax-highlighter/dist/esm/light-async'; import dark from 'react-syntax-highlighter/dist/esm/styles/hljs/dark'; import docco from 'react-syntax-highlighter/dist/esm/styles/hljs/docco';