refactor(web): migrate to Vitest and esm (#29974)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
This commit is contained in:
Stephen Zhou
2025-12-22 16:35:22 +08:00
committed by GitHub
parent 42f7ecda12
commit eabdc5f0eb
268 changed files with 5455 additions and 6307 deletions
+8 -5
View File
@@ -1,8 +1,11 @@
const { codeInspectorPlugin } = require('code-inspector-plugin')
import { codeInspectorPlugin } from 'code-inspector-plugin'
import withBundleAnalyzerInit from '@next/bundle-analyzer'
import createMDX from '@next/mdx'
import withPWAInit from 'next-pwa'
const isDev = process.env.NODE_ENV === 'development'
const withPWA = require('next-pwa')({
const withPWA = withPWAInit({
dest: 'public',
register: true,
skipWaiting: true,
@@ -69,7 +72,7 @@ const withPWA = require('next-pwa')({
}
]
})
const withMDX = require('@next/mdx')({
const withMDX = createMDX({
extension: /\.mdx?$/,
options: {
// If you use remark-gfm, you'll need to use next.config.mjs
@@ -81,7 +84,7 @@ const withMDX = require('@next/mdx')({
// providerImportSource: "@mdx-js/react",
},
})
const withBundleAnalyzer = require('@next/bundle-analyzer')({
const withBundleAnalyzer = withBundleAnalyzerInit({
enabled: process.env.ANALYZE === 'true',
})
@@ -145,4 +148,4 @@ const nextConfig = {
}
}
module.exports = withPWA(withBundleAnalyzer(withMDX(nextConfig)))
export default withPWA(withBundleAnalyzer(withMDX(nextConfig)))