修复export格式下复杂url的访问bug

This commit is contained in:
tangly1024.com
2024-06-19 15:47:14 +08:00
parent 4837dc4eef
commit e502f454b8
3 changed files with 22 additions and 11 deletions

View File

@@ -32,6 +32,16 @@ const locales = (function () {
return langs
})()
// 编译前执行
const preBuild = (function () {
// 删除 public/sitemap.xml 文件 否则会和/pages/sitemap.xml.js 冲突。
const sitemapPath = path.resolve(__dirname, 'public', 'sitemap.xml')
if (fs.existsSync(sitemapPath)) {
fs.unlinkSync(sitemapPath)
console.log('Deleted existing sitemap.xml from public directory')
}
})()
/**
* 扫描指定目录下的文件夹名,用于获取所有主题
* @param {*} directory