1- const path = require ( "path" ) ;
2- require ( "dotenv" ) . config ( ) ;
1+ import path from "path" ;
2+ import dotenv from "dotenv" ;
3+
4+ import remarkMath from "remark-math" ;
5+ import rehypeKatex from "rehype-katex" ;
6+ import fs from "fs" ;
7+ import { themes } from "prism-react-renderer" ;
8+ import type { Config } from "@docusaurus/types" ;
9+ import type * as Preset from "@docusaurus/preset-classic" ;
10+ import npm2yarn from "@docusaurus/remark-plugin-npm2yarn" ;
11+ const sidebarPath = require . resolve ( "./sidebars" ) ;
12+ const customCss = require . resolve ( "./src/css/custom.css" ) ;
13+ // Initialize dotenv
14+ dotenv . config ( ) ;
15+
316const githubOrg = "web3auth" ;
417const githubRepo = "web3auth-docs" ;
518const githubOrgUrl = `https://github.com/${ githubOrg } ` ;
619const githubRepoUrl = `${ githubOrgUrl } /${ githubRepo } ` ;
720const githubEditUrl = `${ githubRepoUrl } /edit/master` ;
8- const remarkMath = require ( "remark-math" ) ;
9- const rehypeKatex = require ( "rehype-katex" ) ;
10- const fs = require ( "fs" ) ;
1121const baseUrl = process . env . REACT_APP_BASE_URL || "/docs/" ;
12- const { themes } = require ( "prism-react-renderer" ) ;
1322
1423const resourcesDropdown = fs . readFileSync ( "./src/components/navDropdown/resources.html" , "utf-8" ) ;
1524const helpDropdown = fs . readFileSync ( "./src/components/navDropdown/help.html" , "utf-8" ) ;
1625const sdkDropdown = fs . readFileSync ( "./src/components/navDropdown/sdk.html" , "utf-8" ) ;
17- import type { Config } from "@docusaurus/types" ;
18- import type * as Preset from "@docusaurus/preset-classic" ;
1926
2027const config : Config = {
2128 title : "Documentation | Web3Auth" ,
@@ -194,15 +201,12 @@ const config: Config = {
194201 routeBasePath : "/" ,
195202 breadcrumbs : true ,
196203 editUrl : githubEditUrl ,
197- sidebarPath : require . resolve ( "./sidebars.js" ) ,
198- remarkPlugins : [
199- remarkMath ,
200- [ require ( "@docusaurus/remark-plugin-npm2yarn" ) , { sync : true } ] ,
201- ] ,
204+ sidebarPath,
205+ remarkPlugins : [ remarkMath , [ npm2yarn , { sync : true } ] ] ,
202206 rehypePlugins : [ [ rehypeKatex , { strict : false } ] ] ,
203207 } ,
204208 theme : {
205- customCss : require . resolve ( "./src/css/custom.css" ) ,
209+ customCss,
206210 } ,
207211 gtag : {
208212 trackingID : "GTM-NFBSNHL" ,
@@ -218,10 +222,7 @@ const config: Config = {
218222 "**/__tests__/**" ,
219223 ] ,
220224 mdxPageComponent : "@theme/MDXPage" ,
221- remarkPlugins : [
222- remarkMath ,
223- [ require ( "@docusaurus/remark-plugin-npm2yarn" ) , { sync : true } ] ,
224- ] ,
225+ remarkPlugins : [ remarkMath , [ npm2yarn , { sync : true } ] ] ,
225226 rehypePlugins : [ [ rehypeKatex , { strict : false } ] ] ,
226227 beforeDefaultRemarkPlugins : [ ] ,
227228 beforeDefaultRehypePlugins : [ ] ,
0 commit comments