Allow highlight.js tree shaking; reduced production bundle size
This commit is contained in:
parent
b21c10ab0b
commit
1bdae1569a
|
@ -1,10 +1,5 @@
|
|||
import React from "react";
|
||||
import { Light as SyntaxHighlighter } from "react-syntax-highlighter";
|
||||
import hljs from "highlight.js";
|
||||
import docco from "react-syntax-highlighter/dist/esm/styles/hljs/docco";
|
||||
|
||||
import hljsDefineSolidity from "highlightjs-solidity";
|
||||
hljsDefineSolidity(hljs);
|
||||
import { SyntaxHighlighter, docco } from "../highlight-init";
|
||||
|
||||
type ABIProps = {
|
||||
abi: any[];
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
import React from "react";
|
||||
import { Light as SyntaxHighlighter } from "react-syntax-highlighter";
|
||||
import hljs from "highlight.js";
|
||||
import docco from "react-syntax-highlighter/dist/esm/styles/hljs/docco";
|
||||
import { SyntaxHighlighter, docco } from "../highlight-init";
|
||||
import { useContract } from "../useSourcify";
|
||||
|
||||
import hljsDefineSolidity from "highlightjs-solidity";
|
||||
import { useAppConfigContext } from "../useAppConfig";
|
||||
hljsDefineSolidity(hljs);
|
||||
|
||||
type ContractProps = {
|
||||
checksummedAddress: string;
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
import { Light as SyntaxHighlighter } from "react-syntax-highlighter";
|
||||
|
||||
// @ts-ignore
|
||||
import hljs from "highlight.js/lib/core";
|
||||
|
||||
// @ts-ignore
|
||||
import json from "highlight.js/lib/languages/json";
|
||||
import docco from "react-syntax-highlighter/dist/esm/styles/hljs/docco";
|
||||
|
||||
import hljsDefineSolidity from "highlightjs-solidity";
|
||||
hljsDefineSolidity(hljs);
|
||||
hljs.registerLanguage("json", json);
|
||||
|
||||
export { SyntaxHighlighter, docco };
|
Loading…
Reference in New Issue