Web App developer with a fervor for the hottest frameworks and DevOps strategies. Hyped about JAMstack, React, Gatsby, GraphQL, Svelte, Hasura, Electron, Node, Docker, serverless functions, and more.
Can you explain what the purpose of the "builds" block is (in now.json)? Why are we setting src, use, and distDir the way you've outlined here?
Note that Zeit Now automatically inspects the package.json for a build command, so there isn't a need to explicitly set now-build. You can just use the regular "build": "gatsby build", which comes as a default command in package.json when using a Gatsby starter.
For other readers looking at the now.json and package.json in the Using CLI and Using GitHub sections and wondering how they are different in each section - I just checked with an online diff tool, and they are exactly the same...don't be like me, scrolling back and forth to try and find differences between them :)
There is a need, now.sh automatically looks for dist folder and Gatsby generates a public folder. So you either have to make gatsby build itself inside dist or ask now.sh to deploy the public folder.
Can you explain what the purpose of the "builds" block is (in now.json)? Why are we setting
src
,use
, anddistDir
the way you've outlined here?Note that Zeit Now automatically inspects the package.json for a
build
command, so there isn't a need to explicitly setnow-build
. You can just use the regular"build": "gatsby build",
which comes as a default command inpackage.json
when using a Gatsby starter.For other readers looking at the
now.json
andpackage.json
in theUsing CLI
andUsing GitHub
sections and wondering how they are different in each section - I just checked with an online diff tool, and they are exactly the same...don't be like me, scrolling back and forth to try and find differences between them :)There is a need, now.sh automatically looks for dist folder and Gatsby generates a public folder. So you either have to make gatsby build itself inside dist or ask now.sh to deploy the public folder.
For your second question, using a now-build script is recommended by the official docs: docs-git-plug-n-play-master.zeit.n...