AnomalyInnovations / serverless-bundle

Optimized packages for ES6 and TypeScript Node.js Lambda functions without any configuration.
https://serverless-stack.com/chapters/package-lambdas-with-serverless-bundle.html
MIT License
536 stars 157 forks source link

Conditional bundling #37

Open arqex opened 5 years ago

arqex commented 5 years ago

Hi, thanks for this great plugin that makes everything easier!

Is it possible to conditionally load the plugin or not depending on the stage we are? Eg: I don't want to bundle when I am running serverless for development in my computer with serverless-online.

It's not possible to do so using variables in the serverless.yml file, so it would be great if there was an option bundle: true|false to activate or deactivate the plugin via config.

Similar plugins have the option already, see the Speeding up Development section of this blog: https://www.jeremydaly.com/how-to-optimize-the-serverless-optimizer-plugin/

But serverless-bundle is the one that is working best for me!

Thanks

jayair commented 4 years ago

Hi @arqex that's a good suggestion. I haven't tested this but wouldn't it be possible to load the plugins list in your serverless.yml based on the stage? Give it a try and let me know if it works?