Skip to content

Commit 9a5a5bd

Browse files
committed
fix katex build error
1 parent 68b0e5b commit 9a5a5bd

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

next.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const path = require('path')
12
const withNextra = require('nextra')({
23
theme: 'nextra-theme-docs',
34
themeConfig: './theme.config.jsx'
@@ -15,6 +16,13 @@ module.exports = withNextra({
1516
basePath,
1617
assetPrefix: basePath,
1718
trailingSlash: true,
19+
webpack: (config) => {
20+
config.resolve.alias['katex/dist/katex.min.css'] = path.join(
21+
__dirname,
22+
'styles/katex.min.css'
23+
)
24+
return config
25+
},
1826
})
1927

2028
// If you have other Next.js configurations, you can pass them as the parameter above

0 commit comments

Comments
 (0)