Skip to content

Commit 6740261

Browse files
committed
取消自动清理sitemap
1 parent 3220bf4 commit 6740261

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

next.config.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ const locales = (function () {
3333
})()
3434

3535
// 编译前执行
36-
const preBuild = (function () {
37-
// 删除 public/sitemap.xml 文件 ; 否则会和/pages/sitemap.xml.js 冲突。
38-
const sitemapPath = path.resolve(__dirname, 'public', 'sitemap.xml')
39-
if (fs.existsSync(sitemapPath)) {
40-
fs.unlinkSync(sitemapPath)
41-
console.log('Deleted existing sitemap.xml from public directory')
42-
}
43-
})()
36+
// const preBuild = (function () {
37+
// // 删除 public/sitemap.xml 文件 ; 否则会和/pages/sitemap.xml.js 冲突。
38+
// const sitemapPath = path.resolve(__dirname, 'public', 'sitemap.xml')
39+
// if (fs.existsSync(sitemapPath)) {
40+
// fs.unlinkSync(sitemapPath)
41+
// console.log('Deleted existing sitemap.xml from public directory')
42+
// }
43+
// })()
4444

4545
/**
4646
* 扫描指定目录下的文件夹名,用于获取所有主题

0 commit comments

Comments
 (0)