This plugin automatically runs
dotnet restore and
dotnet lambda package during package and deployment of Serverless functions. This removes the need for extra build scripts to run these commands manually.
Tested against Serverless v1.17.0
Inspired by https://github.com/fruffin/serverless-dotnet
To install, add serverless-dotnet-package to your
npm install serverless-dotnet-package --save
Now add the plugin to your
The default settings of the plugin will create a package with just the compiled code using Release mode and netcoreapp1.0.
An example of all options is:
dotnetpackage:include:- extra/**configuration: Debugframework: netcoreapp1.1
Sometimes it can be helpful to include extra files along with your compiled code. This can be done by listing globs of files to include in the include section. This is similar to the default Serverless mechanism of including extra files.
Release mode and framework
Configuration can be changed to Debug mode, and different versions of the framework. The default options use Release mode and netcoreapp1.0 - this can be changed as in the example to other options.
dotnetpackage:configuration: Debugframework: netcoreapp1.1
This package overrides the default packaging behaviour of Serverless and thus the default include/exclude options of the framework will do nothing.