Run vercel-build programmatically

This commit is contained in:
Sam Carlton 2022-09-04 11:41:15 -05:00
parent b78702c53b
commit 19f50c4d64
2 changed files with 21 additions and 1 deletions

View file

@ -49,7 +49,7 @@
"clone-readme": "cp ./README.md README-temp.md",
"scan-new-apps": "npx vite-node scripts/scan-new-apps.js",
"cloudflare-deploy": "npm run build-api",
"build-for-vercel": "run-s scan-new-apps test-prebuild build-lists-and-api test-postbuild-api",
"vercel-build": "npx vite-node scripts/vercel-build.js",
"netlify-build": "run-s test-prebuild-functions download-sitemaps stork-index generate-astro test-postbuild-functions test-circular-deps"
},
"dependencies": {

20
scripts/vercel-build.js Normal file
View file

@ -0,0 +1,20 @@
const { execSync } = require('child_process')
;(async () => {
// scan-new-apps test-prebuild build-lists-and-api test-postbuild-api
const steps = [
'scan-new-apps',
'test-prebuild',
'build-lists-and-api',
'test-postbuild-api'
]
for ( const stepScriptName of steps ) {
console.log( `Running step: ${ stepScriptName }` )
execSync( `npm run ${ stepScriptName }`, { stdio: 'inherit' } )
}
process.exit()
})()