update next.config.mjs
Browse files- next.config.mjs +5 -0
next.config.mjs
CHANGED
|
@@ -1,5 +1,10 @@
|
|
| 1 |
import createMDX from '@next/mdx'
|
| 2 |
import path from 'path'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
const withMDX = createMDX({
|
| 5 |
extension: /\.mdx$/,
|
|
|
|
| 1 |
import createMDX from '@next/mdx'
|
| 2 |
import path from 'path'
|
| 3 |
+
import { fileURLToPath } from 'url'
|
| 4 |
+
|
| 5 |
+
// ESM 下获取项目根目录
|
| 6 |
+
const __filename = fileURLToPath(import.meta.url)
|
| 7 |
+
const __dirname = path.dirname(__filename)
|
| 8 |
|
| 9 |
const withMDX = createMDX({
|
| 10 |
extension: /\.mdx$/,
|