Discussion: best way to approach google functions - packaging/zipping/deploying

The root directory needs a file named index.js, function.js or a package.json (with an entrypoint defined). This is a problem right now as the package.json is taken which has the Google Provider plugin as a dependency. Completely ignoring the index.js or function.js of the service (if the user won’t define it in the package.json which is not yet done by default). (taken from: https://github.com/serverless/serverless-google-cloudfunctions/issues/5#issue-188715309)

What is the best approach to take here:

  1. exclude the package.json and node_modules directory in the boilerplate and create a separate folder with its own package.json and node_modules ?
  2. define the entrypoint in package.json to be either index.js or function.js and exclude only serverless-google-cloudfunctions plugin
  3. some other option ??

What do you guys think ?

1 Like

I’m new to Serverless Framework and #1 seems like the best way to avoid bleeding serverless concerns into your app code, but how do you specify a sub directory as a Serverless deployment target?