Build lists on Vercel

This commit is contained in:
Sam Carlton 2022-04-25 14:46:09 -05:00
parent 1d5df0a193
commit 06da49cb4a
2 changed files with 8 additions and 4 deletions

View file

@ -26,7 +26,10 @@ import { makeSearchableList } from './helpers/searchable-list.js'
dotenv.config() dotenv.config()
const commandArguments = process.argv const commandArguments = process.argv
const withApi = commandArguments.includes('--with-api') const withApi = commandArguments.includes('--with-api')
const noLists = commandArguments.includes('--no-lists')
@ -169,7 +172,7 @@ class BuildLists {
// Run all listsOprions methods // Run all listsOprions methods
// and store them to this.lists // and store them to this.lists
async buildLists () { async buildLists () {
console.log('Build Lists started') console.log( 'Build Lists started', commandArguments )
for ( const listOptions of this.listsOptions ) { for ( const listOptions of this.listsOptions ) {
@ -249,7 +252,7 @@ class BuildLists {
const listOptions = this.listsOptions[listOptionsKey] const listOptions = this.listsOptions[listOptionsKey]
if ( !withApi ) { if ( noLists ) {
await this.saveList( listOptions ) await this.saveList( listOptions )
} }

View file

@ -14,7 +14,8 @@
"test": "ava --timeout=1m --verbose", "test": "ava --timeout=1m --verbose",
"dev": "nuxt", "dev": "nuxt",
"build": "nuxt build", "build": "nuxt build",
"build-api": "npm run clone-readme && npm run build-lists -- --with-api", "build-api": "npm run clone-readme && npm run build-lists -- --with-api --no-lists",
"build-lists-and-api": "npm run clone-readme && npm run build-lists -- --with-api",
"start": "nuxt start", "start": "nuxt start",
"generate-dev": "npm run generate && npm test", "generate-dev": "npm run generate && npm test",
"generate": "npm run clone-readme && npm run build-lists && npm run generate-nuxt && npm run generate-eleventy", "generate": "npm run clone-readme && npm run build-lists && npm run generate-nuxt && npm run generate-eleventy",
@ -31,7 +32,7 @@
"precommit": "npm run lint", "precommit": "npm run lint",
"clone-readme": "cp ./README.md README-temp.md", "clone-readme": "cp ./README.md README-temp.md",
"cloudflare-deploy": "npm run build-api", "cloudflare-deploy": "npm run build-api",
"vercel-build": "npm run build-api" "vercel-build": "npm run build-lists-and-api"
}, },
"dependencies": { "dependencies": {
"@11ty/eleventy-assets": "^1.0.5", "@11ty/eleventy-assets": "^1.0.5",