You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for maximum bundle size like rspack and webpack have.
🤔 Expected Behavior
When setting maximum bundle size, the code splitting algorithm will try to split chunks bigger than the given maximum into smaller chunks if possible.
😯 Current Behavior
Not possible to set a maximum bundle size, I believe.
💁 Possible Solution
We originally used webpack for our needs and have since moved to repack. We are happy with their code splitting functionality which is quite complete so perhaps you can draw inspiration from.
🔦 Context
Our bundling needs are actually for AWS Lambdas for node applications. In reality the code for a lambda is basically a Node.js library with a single function export. One of the optimizations in terms of cold starts is to bundle each lambda code into 1 file (or multiple when splitting at a certain maximum size) instead of deploying all node modules which we all know is not great.
However, we bundle our lambdas without minification because that allows us to have deployed code which is very close to the original and we can edit it on the fly in production whenever there is some issue and have good stack traces on exceptions without fiddling with source maps. The problem is that the AWS Lambda editor does not allow to open files larger than 3MiB, which is where our need comes from. Some of our lambdas are bigger than 3MiB after bundling their dependencies and we need to split it into chunks of that maximum size, so that we can open those files in the web console if we need to edit them on the fly for whatever reason.
The text was updated successfully, but these errors were encountered:
Not exactly the same thing but you might be able to accomplish something similar with the manual shared bundles feature. There is a split option that can split large bundles into multiple. Requires a bit more configuration though.
We have hundreds of lambdas, that would require tweaking each one individually to more or less be within the thresholds we want. I'd rather keep with rspack for now until I find something better
🙋 feature request
Add support for maximum bundle size like rspack and webpack have.
🤔 Expected Behavior
When setting maximum bundle size, the code splitting algorithm will try to split chunks bigger than the given maximum into smaller chunks if possible.
😯 Current Behavior
Not possible to set a maximum bundle size, I believe.
💁 Possible Solution
We originally used webpack for our needs and have since moved to repack. We are happy with their code splitting functionality which is quite complete so perhaps you can draw inspiration from.
🔦 Context
Our bundling needs are actually for AWS Lambdas for node applications. In reality the code for a lambda is basically a Node.js library with a single function export. One of the optimizations in terms of cold starts is to bundle each lambda code into 1 file (or multiple when splitting at a certain maximum size) instead of deploying all node modules which we all know is not great.
However, we bundle our lambdas without minification because that allows us to have deployed code which is very close to the original and we can edit it on the fly in production whenever there is some issue and have good stack traces on exceptions without fiddling with source maps. The problem is that the AWS Lambda editor does not allow to open files larger than 3MiB, which is where our need comes from. Some of our lambdas are bigger than 3MiB after bundling their dependencies and we need to split it into chunks of that maximum size, so that we can open those files in the web console if we need to edit them on the fly for whatever reason.
The text was updated successfully, but these errors were encountered: