You are right, and I quickly went over it because I was scared of loosing the focus of the post by explaining into details many small parts.
This is a balance you have to consider. If a user never clicks on the link, this method has an advantage over minifying everything since you would load the JS without using it.
On the other hand, if a user keeps clicking the link while being on the same page (Important to stay on the same page), it would be better to have it stored in your minified chunk.
It's a low hanging fruit optimization that can be very useful IMO.
This is a balance you have to consider. If a user never clicks on the link, this method has an advantage over minifying everything since you would load the JS without using it.
On the other hand, if a user keeps clicking the link while being on the same page (Important to stay on the same page), it would be better to have it stored in your minified chunk.
It's a low hanging fruit optimization that can be very useful IMO.