Allow filtering files after webpack runs but before packaging.
When you have source maps enabled, source-maps get bundled in the deployment package (zip file) along with the compiled js bundle.
If you're using a separate Error Reporting system like Sentry you don't need to upload the source maps in the package zip file. This reduces the final package zip size by ~ 50%.
If we do that, then we'll have to build once again after packaging/deploy to get the source-maps to upload to Sentry.
_P.S. I don't mind sending a PR for this, I just want to use this issue to discuss the feature_
Hello guys!
Any progress on this issue?
My webpack config generates map files as well as report.html files from the bundle analyzer plugin. These get bundled thus more than doubling the size of my lambda packages.
One workaround I tried was to force the path of source map to a different folder. However this does not work for the bundle size report with multiple entry points as it is not compatible with qualifiers such as [file].
I also tried adding entries in a .gitignore file so that npm does not package them but that does not work either.
It would be great if I could just tell serverless webpack to ignore those files.
Thanks!
Hello guys!
Any progress on this issue?My webpack config generates map files as well as report.html files from the bundle analyzer plugin. These get bundled thus more than doubling the size of my lambda packages.
One workaround I tried was to force the path of source map to a different folder. However this does not work for the bundle size report with multiple entry points as it is not compatible with qualifiers such as [file].
I also tried adding entries in a .gitignore file so that npm does not package them but that does not work either.
It would be great if I could just tell serverless webpack to ignore those files.
Thanks!
I have this same problem. It's wonderfully ironic that I wanted to analyze the bundle size to make it smaller, but the report.html doubled it's size!
We do have an option excludeRegex which remove some fiels from the zip.
https://github.com/serverless-heaven/serverless-webpack#exclude-files-with-regular-expression
Can this solve your problem?
That seems to fix it for me on v5.5.0 thanks!
custom:
webpack:
excludeRegex: report\.html