-
Notifications
You must be signed in to change notification settings - Fork 203
Description
Hello, I've been facing a problem for some time and I have no clue what to do.
I work on a very large system with most of it's functionally implemented on the front end. We have more than 2mb on minified javascript files that needs to load in different parts of the system.
When I just curl every module, everything runs fine. But as you may know, it makes A LOT of http requests, around 100 just for the system to load.
So we decided to use CRAM to create bundles with all modules included. A single bundle just kept growing and growing, while most of it's modules weren't being used but had to be transfered.
Then we split this bundle into multiple by it's functions. The dashboards got one, the login page one, the graphics one and etc.
Everything was running fine until these bundles had to share modules between then.
Everytime a bundle was loaded with a module in it that was already loaded, curl would throw a "Duplicate define" error.
The only workaround that I could think was to remove the shared files from all bundles and let it load just in time, but then, there are a lot of http requests.
Do you have any suggestion by which way we should go? Is having a giant bundle the answer?
A problem with big bundles, is that all modules are loaded eagerly instead of JIT, so having a big bundle would result in poor initial performance. (#258)
Thank you all, and sorry for any english mistakes.