serverless-bundle icon indicating copy to clipboard operation
serverless-bundle copied to clipboard

expose Webpack options for disabling "mangle" and/or "minize"

Open meunierfrederic opened this issue 2 years ago • 3 comments

Hello,

We encounter troubles when deploying our backend aws lambda functions with v5 since minimize is now mandatory in production mode. We are using components which access to class names (for instance type-graphql). They are mangled by the minimizer (obfuscating our GraphQL Schema). In some cases, the mangled class names are not consistent (we have a "monorepo" project for our backend with some workspace inter dependencies).

Is it possible to expose the Webpack "minimize" option (a boolean) to serverless.yml? Or better, the "mangle" (or equivalent) option of the minimizer?

Thanks a lot

meunierfrederic avatar May 30 '22 15:05 meunierfrederic

THIS. I have an API that is now completely broken on deployment after updating dependencies, because the serverless-mysql plugin output gets mangled by the webpack minification. Having opinionated defaults for webpack config is one thing, but having absolutely no way to override is just wrong, unless you want to state up front that the serverless-bundle plugin is only designed for a very narrow range of specific scenarios.

jgwheeler avatar Jun 01 '22 21:06 jgwheeler

Been a major pain for me also where I needed to role my own custom webpack build solely because packages like https://www.npmjs.com/package/@pdftron/pdfnet-node die due to webpack minification.

Duplicated maybe by - https://github.com/AnomalyInnovations/serverless-bundle/issues/286

JacobSiegle avatar Oct 07 '22 13:10 JacobSiegle

5.5 fixes this! I was debudding basically in the dark

fabiosenracorrea avatar Aug 10 '23 22:08 fabiosenracorrea