fix error
Browse files- next.config.mjs +7 -7
- tsconfig.json +16 -2
next.config.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
import path from 'path'
|
| 2 |
-
import { fileURLToPath } from 'url'
|
| 3 |
import withMDX from '@next/mdx'
|
| 4 |
|
| 5 |
-
|
| 6 |
-
const
|
| 7 |
-
|
| 8 |
-
export default withMDX({
|
| 9 |
pageExtensions: ['ts', 'tsx', 'mdx'],
|
| 10 |
webpack(config) {
|
| 11 |
-
config.resolve.alias['@'] = path.resolve(
|
| 12 |
return config
|
| 13 |
-
}
|
| 14 |
})
|
|
|
|
|
|
|
|
|
| 1 |
import path from 'path'
|
|
|
|
| 2 |
import withMDX from '@next/mdx'
|
| 3 |
|
| 4 |
+
/** @type {import('next').NextConfig} */
|
| 5 |
+
const nextConfig = withMDX({
|
| 6 |
+
extension: /\.mdx?$/,
|
|
|
|
| 7 |
pageExtensions: ['ts', 'tsx', 'mdx'],
|
| 8 |
webpack(config) {
|
| 9 |
+
config.resolve.alias['@'] = path.resolve('./') // @ 指向根目录
|
| 10 |
return config
|
| 11 |
+
}
|
| 12 |
})
|
| 13 |
+
|
| 14 |
+
export default nextConfig
|
tsconfig.json
CHANGED
|
@@ -1,9 +1,23 @@
|
|
| 1 |
{
|
| 2 |
"compilerOptions": {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
"baseUrl": ".",
|
| 4 |
"paths": {
|
| 5 |
"@/*": ["./*"]
|
| 6 |
}
|
| 7 |
},
|
| 8 |
-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.mdx"]
|
| 9 |
-
|
|
|
|
|
|
| 1 |
{
|
| 2 |
"compilerOptions": {
|
| 3 |
+
"target": "esnext",
|
| 4 |
+
"module": "esnext",
|
| 5 |
+
"lib": ["dom", "dom.iterable", "esnext"],
|
| 6 |
+
"allowJs": true,
|
| 7 |
+
"skipLibCheck": true,
|
| 8 |
+
"strict": true,
|
| 9 |
+
"forceConsistentCasingInFileNames": true,
|
| 10 |
+
"noEmit": true,
|
| 11 |
+
"esModuleInterop": true,
|
| 12 |
+
"moduleResolution": "node",
|
| 13 |
+
"resolveJsonModule": true,
|
| 14 |
+
"isolatedModules": true,
|
| 15 |
+
"jsx": "preserve",
|
| 16 |
"baseUrl": ".",
|
| 17 |
"paths": {
|
| 18 |
"@/*": ["./*"]
|
| 19 |
}
|
| 20 |
},
|
| 21 |
+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.mdx"],
|
| 22 |
+
"exclude": ["node_modules"]
|
| 23 |
+
}
|