Feature/build step (#2)
* BundleAnalyzerPlugin * lazy load highlight.js * seperate bundles for each page * prerender apps to html on build * preload important font files * dont prerender code copy button * fix woff2 variant of font * added missing doctype * remove metatags component
This commit is contained in:
@@ -68,8 +68,8 @@ class Code extends React.Component<CodeProps, CodeState> {
|
||||
const { language, children } = this.props;
|
||||
|
||||
if (language !== undefined) {
|
||||
const { highlight } = await import(/* webpackChunkName: 'highlight.js' */ 'highlight.js');
|
||||
const { value: hlCode } = highlight(language, children as string);
|
||||
const { default: hljs } = await System.import(/* webpackChunkName: 'highlightjs' */ 'ts/highlight');
|
||||
const { value: hlCode } = hljs.highlight(language, children as string);
|
||||
this.setState({ hlCode });
|
||||
}
|
||||
}
|
||||
@@ -102,7 +102,7 @@ class Code extends React.Component<CodeProps, CodeState> {
|
||||
<StyledCode>{this.props.children}</StyledCode>
|
||||
)}
|
||||
</StyledPre>
|
||||
<Button onClick={this.handleCopy}>Copy</Button>
|
||||
{navigator.userAgent !== 'ReactSnap' ? <Button onClick={this.handleCopy}>Copy</Button> : null}
|
||||
{!('clipboard' in navigator) ? (
|
||||
<CopyInput readOnly aria-hidden="true" ref={this.code} value={children} />
|
||||
) : null}
|
||||
|
Reference in New Issue
Block a user