Tracked
- NPM Downloads Last Month
- 9
- Issues
- 0
- Stars
- 0
- Forks
- 0
- Watchers
- 0
Register a transpiler function which will serve as a file content transformer before they land in lambda package.
$ npm install serverless-plugin-transpiler
serverless.yml
)serverless.yml
plugins:
- serverless-plugin-transpiler
Transpiler should be a function that on content
(file contents) and filePath
(full path to module) returns transpiled (if needed) content. Handling is as follows:
null
or undefined
then it is assumed that no transpilation was applied to this file, and original file content is passed as it is.Example transpiler:
module.exports = function (content, filePath) {
if (!filePath.endsWith(".js")) return null; // transpile only JS files
return transpileES2019Feature(content);
}
serverless.yml
custom:
transpilerPath: lib/transpile.js