Hi Cong Le,
Yes, this is correct, by default Kentico bundles all widgets together and I'm not aware of any optimisation to serve only CSS/JS used on the page.
If you have a lot of widgets, I would assume you are working on a fairly large and complex website. For these cases I believe the recommended practice would be to work on the frontend code separately, maybe not even including it into Visual Studio.
In our agency we are using the following approach, which is obviously a custom code:
- JS/CSS build is managed separately and our frontend developers use their favourite tools to work on this code
- the result of the frontend build contains a manifest.json file which contains a list of all component small JS/CSS files compiled
- then, in Xperience solution we have a custom tag helper where you can specify the name of the frontend component, this tag helper will find appropriate JS/CSS from manifest.json and reference these small files, if those haven't been referenced before during this page execution (the files already referenced during the page execution can be stored and checked in request context)
I would definitely recommend allocating some time to develop similar custom approach which will be working for your team and use it across multiple projects.