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
+
3
16
const githubOrg = "web3auth" ;
4
17
const githubRepo = "web3auth-docs" ;
5
18
const githubOrgUrl = `https://github.com/${ githubOrg } ` ;
6
19
const githubRepoUrl = `${ githubOrgUrl } /${ githubRepo } ` ;
7
20
const githubEditUrl = `${ githubRepoUrl } /edit/master` ;
8
- const remarkMath = require ( "remark-math" ) ;
9
- const rehypeKatex = require ( "rehype-katex" ) ;
10
- const fs = require ( "fs" ) ;
11
21
const baseUrl = process . env . REACT_APP_BASE_URL || "/docs/" ;
12
- const { themes } = require ( "prism-react-renderer" ) ;
13
22
14
23
const resourcesDropdown = fs . readFileSync ( "./src/components/navDropdown/resources.html" , "utf-8" ) ;
15
24
const helpDropdown = fs . readFileSync ( "./src/components/navDropdown/help.html" , "utf-8" ) ;
16
25
const 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" ;
19
26
20
27
const config : Config = {
21
28
title : "Documentation | Web3Auth" ,
@@ -194,15 +201,12 @@ const config: Config = {
194
201
routeBasePath : "/" ,
195
202
breadcrumbs : true ,
196
203
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 } ] ] ,
202
206
rehypePlugins : [ [ rehypeKatex , { strict : false } ] ] ,
203
207
} ,
204
208
theme : {
205
- customCss : require . resolve ( "./src/css/custom.css" ) ,
209
+ customCss,
206
210
} ,
207
211
gtag : {
208
212
trackingID : "GTM-NFBSNHL" ,
@@ -218,10 +222,7 @@ const config: Config = {
218
222
"**/__tests__/**" ,
219
223
] ,
220
224
mdxPageComponent : "@theme/MDXPage" ,
221
- remarkPlugins : [
222
- remarkMath ,
223
- [ require ( "@docusaurus/remark-plugin-npm2yarn" ) , { sync : true } ] ,
224
- ] ,
225
+ remarkPlugins : [ remarkMath , [ npm2yarn , { sync : true } ] ] ,
225
226
rehypePlugins : [ [ rehypeKatex , { strict : false } ] ] ,
226
227
beforeDefaultRemarkPlugins : [ ] ,
227
228
beforeDefaultRehypePlugins : [ ] ,
0 commit comments