Skip to content
This repository has been archived by the owner. It is now read-only.
Using zip based functions in Netlify
HTML JavaScript CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
functions
public init commit Jul 19, 2018
src
.gitignore remove footgun Aug 6, 2018
README.md Update README.md Aug 11, 2018
netlify.toml init commit Jul 19, 2018
package-lock.json init commit Jul 19, 2018
package.json
yarn.lock init commit Jul 19, 2018

README.md

Netlify function zips   

  1. Create a functions folder

    mkdir functions
  2. Create a sub folder with a function and a package.json file with its dependancies

    The function (right now) needs to have the same name as the folder that contains it.

    Like so: /functions/one/one.js

    /functions
      /one
        one.js <-- function code
        package.json <-- function dependencies
  3. Configure your build directory for functions in netlify.toml

    # netlify.toml file
    [build]
    command = "npm run build"
    publish = "build" # <-- Frontend build dir
    functions = "functions-build" # <-- Functions build dir
  4. During your build, Zip up the function and dependancies and place in functions dist folder functions-build

Future Plans

We are working on streamlining the zips based function flow with a single CLI command!

You can’t perform that action at this time.