Skip to content

Commit 6a43ddf

Browse files
committed
Migarate to ESM config
1 parent 556a8a7 commit 6a43ddf

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

docusaurus.config.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
const { execSync } = require("node:child_process");
2-
const math = require("remark-math");
3-
const katex = require("rehype-katex");
1+
import { themes as prismThemes } from "prism-react-renderer";
2+
import { execSync } from "node:child_process";
3+
import math from "remark-math";
4+
import katex from "rehype-katex";
45

56
/** @type {import("@docusaurus/types").Config} */
6-
module.exports = {
7+
const config = {
78
title: "ut.code(); Learn",
89
tagline: "ut.code(); 公式学習教材",
910
url: "https://learn.utcode.net/",
@@ -30,15 +31,15 @@ module.exports = {
3031
{
3132
docs: {
3233
showLastUpdateTime: true,
33-
sidebarPath: require.resolve("./sidebars.js"),
34+
sidebarPath: "./sidebars.js",
3435
editUrl: "https://github.com/ut-code/utcode-learn/blob/develop/",
3536
remarkPlugins: [math],
3637
rehypePlugins: [katex],
3738
},
3839
theme: {
3940
customCss: [
40-
require.resolve("./node_modules/katex/dist/katex.min.css"),
41-
require.resolve("./src/css/custom.css"),
41+
"./node_modules/katex/dist/katex.min.css",
42+
"./src/css/custom.css",
4243
],
4344
},
4445
},
@@ -52,7 +53,7 @@ module.exports = {
5253
},
5354
},
5455
prism: {
55-
theme: require("prism-react-renderer").themes.github,
56+
theme: prismThemes.github,
5657
},
5758
navbar: {
5859
title: "ut.code(); Learn",
@@ -95,3 +96,5 @@ module.exports = {
9596
},
9697
},
9798
};
99+
100+
export default config;

sidebars.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
module.exports = {
1+
const sidebars = {
22
sidebar: [{ type: "autogenerated", dirName: "." }],
33
};
4+
5+
export default sidebars;

0 commit comments

Comments
 (0)