Allow serverless-webpack configuration options to pass through
See original GitHub issueCurrently, I need to set keepOutputDirectory: true
for serverless-webpack
, but I can’t. There should be a way to pass valid options through to serverless-webpack
instead of shaming people for needing more than the defaults.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Serverless Webpack - Serverless Framework: Plugins
serverless -webpack exposes a lib object, that can be used in your webpack.config.js to make the configuration easier and to build fully dynamic...
Read more >Serverless Webpack in Lambda Simplified 101 - Learn | Hevo
This blog explains the different aspects of Serverless Webpack in Lambda. ... This config option allows you to exclude files from function ...
Read more >Adding Serverless Webpack to your Project - YouTube
When you deploy a serverless project, by default it uploads all of the code into every lambda. This can mean you quickly end...
Read more >Resolving Serverless Webpack Issues | by Dustin Goodman
A story about how I debugged an issue with our webpack bundles on a serverless infrastructure and the key takeaways about developing ...
Read more >Optimise your Lambda functions using Webpack
Today we'll cover why and how to package your Node.js Lambda functions for deployment using Webpack and the Serverless Framework.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That impression comes from the copy in README.md:
But the problem is that if you want to do something outside of what’s explicitly exposed, you have to go and edit the source to add it to the webpack config (I suppose it could also be done with scripts, but that seems kinda gross).
I don’t think adding an option to overlay custom options would be really invalidating the purpose of the plugin. I think it does a great job setting default options! But there needs to be a way to inject/overlay custom options to the webpack config (not just custom options to
serverless-webpack
), or things like aliasing modules to quiet webpack warnings can’t be done. I suspect just loading an overlay file and doing anObject.assign()
would do the trick, though I haven’t tested that; perhaps a PR would be the way to go here?Apologies if that came across as combative, that’s not my intent; I think you’ve done a great job of really simplifying the process of building a usable Webpack serverless module (especially when it comes to including static assets, which is why I tried it out in the first place). Thank you for your hard and probably often thankless work on this very useful plugin.
While we are definitely trending in the direction of adding most of the Webpack options, I’m not sure what’s giving the impression that we are refusing to expose all the options?
That said
keepOutputDirectory
is something we should add. I’m happy to accept PRs for this.While we are on the subject, what other serverless-webpack options do we have left? Aside from the
webpackConfig
option; since altering that invalidates the purpose of this plugin.