From 06da49cb4a6d459ddd7e94522b15db06f920363b Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Mon, 25 Apr 2022 14:46:09 -0500 Subject: [PATCH] Build lists on Vercel --- build-lists.js | 7 +++++-- package.json | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/build-lists.js b/build-lists.js index 3e47c3e..7531b61 100644 --- a/build-lists.js +++ b/build-lists.js @@ -26,7 +26,10 @@ import { makeSearchableList } from './helpers/searchable-list.js' dotenv.config() const commandArguments = process.argv + + const withApi = commandArguments.includes('--with-api') +const noLists = commandArguments.includes('--no-lists') @@ -169,7 +172,7 @@ class BuildLists { // Run all listsOprions methods // and store them to this.lists async buildLists () { - console.log('Build Lists started') + console.log( 'Build Lists started', commandArguments ) for ( const listOptions of this.listsOptions ) { @@ -249,7 +252,7 @@ class BuildLists { const listOptions = this.listsOptions[listOptionsKey] - if ( !withApi ) { + if ( noLists ) { await this.saveList( listOptions ) } diff --git a/package.json b/package.json index 3e41780..930ebd3 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "test": "ava --timeout=1m --verbose", "dev": "nuxt", "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", "generate-dev": "npm run generate && npm test", "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", "clone-readme": "cp ./README.md README-temp.md", "cloudflare-deploy": "npm run build-api", - "vercel-build": "npm run build-api" + "vercel-build": "npm run build-lists-and-api" }, "dependencies": { "@11ty/eleventy-assets": "^1.0.5",