`functionsBuild` hook should come after `build` hook

Hi !

I’m currently trying to deploy my application with the following netlify.yml configuration :

  command: yarn build
  functions: dist/apps/api
  publish: dist/apps/web

The current Netlify Build (not beta) first builds my web app and functions to dist, after what zip-it-and-ship-it comes in to create the ZIP archive to deploy on AWS Lambda.

With the new Netlify Build, the functionsBuilds hook (which creates the ZIP archive) comes before build, which is problematic in my case since dist folder is created at the build step. As a result, I don’t have any Netlify functions deployed.

Hey @jon301

Thanks for the report.

It looks like we will need to tweak how functions and built and ensure that directories are made if they don’t yet exist!

Is this repo available to look at?

Hi @jon301,

This should be fixed now. Could you please verify everything works for you?

Relevant PR: https://github.com/netlify/build/pull/454

Hi @ehmicky

I’ve just verified with Netlify Build v0.1.13 and everything works fine

Thanks for your help !