AnomalyInnovations/serverless-bundle

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

meunierfrederic opened this issue · 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

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.

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 -
#286

5.5 fixes this! I was debudding basically in the dark