build(cf): exclude files larger than 26.2MB
This commit is contained in:
parent
7e745ba6d1
commit
47705495f4
11
src/build.js
11
src/build.js
|
@ -11,7 +11,7 @@ const { stream: gotStream } = require('got')
|
|||
const got = require('got')
|
||||
const unzip = require('extract-zip')
|
||||
const { basename, join } = require('path')
|
||||
const { mkdir } = require('fs/promises')
|
||||
const { mkdir, readdir, rm } = require('fs/promises')
|
||||
const { createWriteStream } = require('fs')
|
||||
const { pipeline } = require('stream/promises')
|
||||
const envVar = process.env
|
||||
|
@ -119,6 +119,15 @@ const f = async () => {
|
|||
await mkdir(tmpPath, { recursive: true })
|
||||
await mkdir(publicPath, { recursive: true })
|
||||
await Promise.all(projects.map((project) => { return dl(project) }))
|
||||
|
||||
const files = await readdir(publicPath)
|
||||
await Promise.all(files.map(async (file) => {
|
||||
// cf pages limits file size to 26.2MB
|
||||
// compressed (br/gz) files are excluded
|
||||
if (file.startsWith('phishing-filter') && file.endsWith('.rules')) {
|
||||
await rm(join(publicPath, file))
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
const oisd = async () => {
|
||||
|
|
Loading…
Reference in New Issue