From 6d010d676bde49244431df566513c8ce65589c05 Mon Sep 17 00:00:00 2001 From: Sara Vieira Date: Tue, 8 Sep 2020 14:39:10 +0200 Subject: [PATCH] fix vercel in static --- .../app/src/app/overmind/effects/vercel.ts | 31 +++++++------------ 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/packages/app/src/app/overmind/effects/vercel.ts b/packages/app/src/app/overmind/effects/vercel.ts index 65d63f6f910..d9796720544 100755 --- a/packages/app/src/app/overmind/effects/vercel.ts +++ b/packages/app/src/app/overmind/effects/vercel.ts @@ -231,6 +231,10 @@ async function getApiData(contents: any, sandbox: Sandbox) { // We'll omit the homepage-value from package.json as it creates wrong assumptions over the now deployment environment. packageJSON = omit(packageJSON, 'homepage'); + // if the template is static we should not have a build command + if (template.name === 'static') { + packageJSON = omit(packageJSON, 'scripts.build'); + } // We force the sandbox id, so Vercel will always group the deployments to a // single sandbox packageJSON.name = nowJSON.name || nowDefaults.name; @@ -241,25 +245,14 @@ async function getApiData(contents: any, sandbox: Sandbox) { apiData.public = nowJSON.public; } - // if now v2 we need to tell now the version, builds and routes - if (nowJSON.version === 1) { - apiData.config = omit(nowJSON, [ - 'public', - 'type', - 'name', - 'files', - 'version', - ]); - apiData.forceNew = true; - } else { - apiData.version = 2; - apiData.builds = nowJSON.builds; - apiData.routes = nowJSON.routes; - apiData.env = nowJSON.env; - apiData.scope = nowJSON.scope; - apiData['build.env'] = nowJSON['build.env']; - apiData.regions = nowJSON.regions; - } + // We need to tell now the version, builds and routes + apiData.version = 2; + apiData.builds = nowJSON.builds; + apiData.routes = nowJSON.routes; + apiData.env = nowJSON.env; + apiData.scope = nowJSON.scope; + apiData['build.env'] = nowJSON['build.env']; + apiData.regions = nowJSON.regions; if (!nowJSON.files && apiData?.files) { apiData.files.push({