build: only remove .rules from Cloudflare Pages

This commit is contained in:
MDLeom 2024-10-27 05:48:36 +00:00
parent 499330a12d
commit b36dea1bde
No known key found for this signature in database
GPG Key ID: 32D3E28E96A695E8
1 changed files with 2 additions and 2 deletions

View File

@ -81,9 +81,9 @@ const f = async () => {
const files = await readdir(publicPath)
await Promise.all(files.map(async (file) => {
// cf pages limits file size to 26.2MB
// cloudflare pages limits file size to 25MB
// compressed (br/gz) files are excluded
if (file.startsWith('phishing-filter') && file.endsWith('.rules')) {
if (process.env.CF_PAGES && file.startsWith('phishing-filter') && file.endsWith('.rules')) {
await rm(join(publicPath, file))
}
}))