Skip to content
Discussion options

You must be logged in to vote

For your case you shouldn't need includeFiles, since the bundler will automatically notice that you are using that file and bundle it into the Serverless Function implicitly. Be sure to use fs.readFileSync() or similar to trigger the bundling mechanism, something like:

import fs from 'fs';

const keys = JSON.parse(fs.readFileSync(__dirname + '/keys.json'));

export default (req, res) => {  }

To answer your original question though, includeFiles property belongs in the config object with the builds array. So something like:

{
  "builds": [
    {
      "src": "api/*.js",
      "use": "@vercel/node",
      "config": {
        "includeFiles": [ "keys.json" ]
      }
    }
  ]
}

Note that you…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by amyegan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants