-
-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
minified build #100
Comments
When I had first worked on serverless-bundle, I had worked on minimizing. But it seemed to slow down the build times by a lot. If you are interested in taking this on, I would start by using https://www.npmjs.com/package/webpack-bundle-analyzer to compare the two outputs. For question 2, I'm not totally sure what you mean. What do you think serverless-bundle is doing different from serverless-plugin-ncc? |
Maybe we can use a version without mangling and compression:
this results in the comments being removed which already helps alot! |
Hi, any updates on this? We would like to use minified build files. Also wondering, maybe not on topic here, but it seems like all optimizations are turned off. Our files are really big after compiling and includes all imported code. Does tree shaking not work in the current webpack setup? |
V5 Beta has minification enabled 🙂 |
@thomaschaaf Thanks! Seems to work 😄 |
So glad I just found this issue, Just got to a point where I realised my serverless functions were including code that I had not imported from a shared lib which obviously meant tree shaking wasn't working. This seems to be solved in the latest v5 beta. Nice work. |
In case you don't want to move to V5 Beta yet, use |
Is there a way to disable minimization? I'm using serverless-mysql in my code and get the following error:
It seems like this is an issue with webpack minimization because rolling back to 4.4.0 fixes the issue |
Related issue: mysqljs/mysql#1655 |
this could be mitigated using the esbuild instead of babel, e.g. with the following config (keepNames set to true is the key point here):
|
Can confirm this fixed the problem with packets in the wrong sequence. Cheers @sromic! bundle:
minifyOptions:
keepNames: true |
Hi, I was comparing the result of the
serverless-bundle
(I'm using the beta branch because I'm using typescript to develop) withserverless-plugin-ncc
and I see that the final bundle of serverless-bundle is quite havier compared toserverless-plugin-ncc
index.js
fromserverless-bundle
is 2,319KBindex.js
fromserverless-plugin-ncc
is 1,105KBI don't know internally if there are differences but as far as I can see it's not possible to minify the serverless-bundle output.
So I've two questions:
serverless-plugin-ncc
seems to not supportserverless-offline
and many cool things that come from your bundle plugin.The text was updated successfully, but these errors were encountered: