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 React from "react";
|
||||||
import { Light as SyntaxHighlighter } from "react-syntax-highlighter";
|
import { SyntaxHighlighter, docco } from "../highlight-init";
|
||||||
import hljs from "highlight.js";
|
|
||||||
import docco from "react-syntax-highlighter/dist/esm/styles/hljs/docco";
|
|
||||||
|
|
||||||
import hljsDefineSolidity from "highlightjs-solidity";
|
|
||||||
hljsDefineSolidity(hljs);
|
|
||||||
|
|
||||||
type ABIProps = {
|
type ABIProps = {
|
||||||
abi: any[];
|
abi: any[];
|
||||||
|
|
|
@ -1,12 +1,7 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { Light as SyntaxHighlighter } from "react-syntax-highlighter";
|
import { SyntaxHighlighter, docco } from "../highlight-init";
|
||||||
import hljs from "highlight.js";
|
|
||||||
import docco from "react-syntax-highlighter/dist/esm/styles/hljs/docco";
|
|
||||||
import { useContract } from "../useSourcify";
|
import { useContract } from "../useSourcify";
|
||||||
|
|
||||||
import hljsDefineSolidity from "highlightjs-solidity";
|
|
||||||
import { useAppConfigContext } from "../useAppConfig";
|
import { useAppConfigContext } from "../useAppConfig";
|
||||||
hljsDefineSolidity(hljs);
|
|
||||||
|
|
||||||
type ContractProps = {
|
type ContractProps = {
|
||||||
checksummedAddress: string;
|
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