menu
up-caret
down-caret

ZEIT

Our mission is to make cloud computing as easy and accessible as mobile computing. You can find our Next.js community here.

# Now

Instant global deployments

Trending conversations
503 on deployment
@codelayer · 22d
ENV variables
@remotealex · 4h
BRU1 instances are timing out
@helguita · 31d
Could someone point me toward strategies for decreasing my PHP lambda size?
@unitof · 5h
Images not showing on CRA deployment
@passingmagic · 5h

Now Rebuilding Everything Every Time

ZEIT/Now · February 21, 2019 at 4:03pm

Now Rebuilding Everything Every Time

February 21, 2019 at 4:03pm (Edited 1 month ago)

I'm using Now to deploy my web app, but even when I only change api.js it rebuilds everything including my Next.js app, which takes a long time. Here's my now.json:

{
"name": "raas",
"version": 2,
"alias": [ "raas" ],
"builds": [
{ "src": "next.config.js", "use": "@now/next" },
{ "src": "api.js", "use": "@now/node-server" },
{ "src": "api/getters/*.js", "use": "@now/node" }
],
"routes": [
{ "src": "/api/(.*)", "dest": "/api.js" },
{ "src": "/d/(?<code>[^/]*)", "dest": "/api/getters/deployment.js?code=$code" }
],
"env": {
"MONGODB": "@raas-mongodb"
}
}

February 21, 2019 at 4:10pm

We certainly have plans to optimize our deployment process. But at the moment, this is the way it works...

  • reply
  • like

@paulogdm It says on Now's homepage that it only rebuilds what's changed.

  • reply
  • like

"Unlike most Continuous Integration (CI) solutions, Now only re-builds the parts of your application that have changed. No matter how large your repository."

  • reply
  • like

I change one file and it rebuilds EVERYTHING. And it isn't only with Next.js...

  • reply
  • like

We had a "dedupe" algorithm but we found issues and disabled it. I will relay your feedback to either bring back the algorithm or remove that entry from our pages.

  • reply
  • like

Can you give me the URL of this statement?

  • reply
  • like

Thank you!

  • reply
  • like

You're welcome. I hope you get that dedupe algo working :D

  • reply
  • like

Maybe you can make it opt-in

  • reply
  • like

Or let people manually specify some sort of data structure that Now can use to figure out what needs to be rebuilded

  • reply
  • like

Like, what relies on what. Could go in now.json

  • reply
  • like

I don't know if I should start a new thread but I believe my issue is related to this.

  • reply
  • like

Tell us about it!

  • reply
  • like

I have a monorepo with 4 things, 3 of them being stuff I will deploy to now and one of them being a mobile app

  • reply
  • like

4 folders, exactly

  • reply
  • like

Ok...

  • reply
  • like

I'm using github integration and when I push only changes to the mobile app folder now redeploys everything

  • reply
  • like

I tried to put the mobile app folder on .nowignore

  • reply
  • like

But it didn't help

  • reply
  • like

What exactly did you put in your nowignore?

  • reply
  • like

Should it be working like this?

  • reply
  • like

Should I move the unrelated app to another project or you guys want to support how I'm doing stuff?

  • reply
  • like

Mind sharing your .nowignore and now.json?

  • reply
  • like
{
"version": 2,
"name": "abacate",
"regions": ["gru1"],
"env": {
...
},
"builds": [
{ "src": "/nextweb/static/policy.html", "use": "@now/static" },
{ "src": "/nextweb/static/logo.png", "use": "@now/static" },
{ "src": "/nextweb/static/font.css", "use": "@now/static" },
{ "src": "/nextweb/static/KeepCalm-Medium.ttf", "use": "@now/static" },
{ "src": "/nextweb/static/favicon.ico", "use": "@now/static" },
{ "src": "/nextweb/package.json", "use": "@now/next@canary" },
{
"src": "/admin/package.json",
"use": "@now/static-build",
"config": { "distDir": "build" }
},
{
"src": "/back/src/index.ts",
"use": "@now/node@canary",
"config": { "maxLambdaSize": "10mb" }
},
{
"src": "/back/src/admin/index.ts",
"use": "@now/node@canary",
"config": { "maxLambdaSize": "10mb" }
}
],
"routes": [
{ "src": "/api", "dest": "/back/src/index.ts" },
{ "src": "/api/(.*)", "dest": "/back/src/index.ts" },
{ "src": "/api_adm", "dest": "/back/src/admin/index.ts" },
{ "src": "/api_adm/(.*)", "dest": "/back/src/admin/index.ts" },
{
"src": "/admin",
"status": 301,
"headers": { "Location": "/admin/index.html" }
},
{
"src": "/admin/static/(.*)",
"headers": { "cache-control": "s-maxage=31536000,immutable" },
"dest": "/admin/static/$1"
},
{ "src": "/admin/favicon.ico", "dest": "/admin/favicon.ico" },
{
"src": "/admin/asset-manifest.json",
"dest": "/admin/asset-manifest.json"
},
{ "src": "/admin/manifest.json", "dest": "/admin/manifest.json" },
{
"src": "/admin/precache-manifest.(.*)",
"dest": "/admin/precache-manifest.$1"
},
{
"src": "/admin/service-worker.js",
"headers": { "cache-control": "s-maxage=0" },
"dest": "/admin/service-worker.js"
},
{
"src": "/admin/(.*)",
"headers": { "cache-control": "s-maxage=0" },
"dest": "/admin/index.html"
},
{ "src": "/static/(.*)", "dest": "/nextweb/static/$1" },
{ "src": "/policy", "dest": "/nextweb/static/policy.html" },
{ "src": "/policy/(.*)", "dest": "/nextweb/static/policy.html" },
{ "src": "/l/(?<id>[^/]*)", "dest": "/nextweb/detalhes?id=$id" },
{ "src": "/(.*)", "dest": "/nextweb/$1" }
]
}
  • reply
  • like
Show more messages