Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 12 additions & 19 deletions packages/app/src/app/overmind/effects/vercel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

V1 is deprecated

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({
Expand Down