
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
kkt-serverless-plugin-optimize
Advanced tools
Bundle with Browserify, transpile and minify with Babel automatically to your NodeJS runtime compatible JavaScript.
This repository is no longer being maintained. Further developments to this repository can be made by forking the project.
Bundle with Browserify, transpile and minify with Babel automatically to your NodeJS runtime compatible JavaScript.
This plugin is a child of the great serverless-optimizer-plugin. Kudos!
Requirements:
Install via npm in the root of your Serverless service:
npm install serverless-plugin-optimize --save-dev
plugins array in your Serverless serverless.yml:plugins:
- serverless-plugin-optimize
package:
individually: true
deploy and invoke local commandsConfiguration options can be set globally in custom property and inside each function in optimize property. Function options overwrite global options.
false) - When debug is set to true it won't remove prefix folder and will generate debug output at the end of package creation.['aws-sdk']) - Array of modules or paths that will be excluded.['.js', '.json']) - Array of optional extra extensions modules that will be included.node_modules instead of being loaded into browserify bundle. Note that external modules will require that its dependencies are within its directory and this plugin will not do this for you. e.g. you should execute the following: (cd external_modules/some-module && npm i --prod)node_modules.false) - When global is set to true transforms will run inside node_modules.true) - When minify is set to false Babili preset won't be added._optimize) - Folder to output bundle.['env']) - Array of Babel presets.custom:
optimize:
debug: true
exclude: ['ajv']
extensions: ['.extension']
external: ['sharp']
externalPaths:
sharp: 'external_modules/sharp'
global: true
ignore: ['ajv']
includePaths: ['bin/some-binary-file']
minify: false
prefix: 'dist'
plugins: ['transform-decorators-legacy']
presets: ['es2017']
true) - When optimize is set to false the function won't be optimized.functions:
hello:
optimize: false
node_modules instead of being loaded into browserify bundle. Note that external modules will require it's dependencies within it's directory. (cd external_modules/some-module && npm i --prod)node_modules.true transforms will run inside node_modules.false Babili preset won't be added.functions:
hello:
optimize:
exclude: ['ajv']
extensions: ['.extension']
external: ['sharp']
externalPaths:
sharp: 'external_modules/sharp'
global: false
ignore: ['ajv']
includePaths: ['bin/some-binary-file']
minify: false
plugins: ['transform-decorators-legacy']
presets: ['es2017']
There is a difference you must know between calling files locally and after optimization with includePaths.
When Optimize packages your functions, it bundles them inside /${prefix}/${functionName}/... and when your lambda function runs in AWS it will run from root /var/task/${prefix}/${functionName}/... and your CWD will be /var/task/.
Solution in #32 by @hlegendre. path.resolve(process.env.LAMBDA_TASK_ROOT, ${prefix}, process.env.AWS_LAMBDA_FUNCTION_NAME, ${includePathFile}).
Help us making this plugin better and future proof.
npm installgit checkout -b new_featurenpm run lintThis software is released under the MIT license. See the license file for more details.
FAQs
Bundle with Browserify, transpile and minify with Babel automatically to your NodeJS runtime compatible JavaScript.
The npm package kkt-serverless-plugin-optimize receives a total of 0 weekly downloads. As such, kkt-serverless-plugin-optimize popularity was classified as not popular.
We found that kkt-serverless-plugin-optimize demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.