Serverless Build Substitute Plugin
A Serverless Build Plugin to substitute files into a build (eg. AWS binaries into node_modules) prior to deployment.
NOTE: currently works on Serverless 0.5.x only.
Support for Serverless 1.0.x is coming once it has reached RC/Stable.
To use simply add serverless-substitute-plugin
to your "plugins"
section in your s-project.json
file.
Then to use you can simply add it as an entry in your serverless.build.yml
file in your project root.
This can be used for deploying AWS compatible binaries into the package before deployment.
Configuration
method: "bundle"
sourceMaps : true
babel : true
uglify : true
exclude:
- "*"
modules:
exclude:
- aws-sdk
deepExclude:
- aws-sdk
substitute:
- from: "bin/somefile.bin"
to: "somefile.bin"
functions:
one:
include:
- "functions/one/**"
- "lib/one/**"
exclude:
- "**/*.json"
substitute:
- from: "bin/iconv.node"
to:
- "node_modules/iconv/build/Release/iconv.node"
- "node_modules/iconv/build/Release/obj.target/iconv.node"
- "node_modules/iconv/build/Debug/iconv.node"
- "node_modules/iconv/build/Debug/obj.target/iconv.node"
- from: "bin/somefile.bin"
to: "somefile.bin"