On the initial page load, our app was loading every mustache file in our app, causing the page load time to be huge. That initial page only used a couple mustache files, so it should only load the ones we need in that view.
We use grunt with can-compile to compile all those mustache files into one js file, but it was still loading all mustache files separately as well.
We were executing can.view like this
When we change that can.view to this (created by can-compile), it works as expected and doesn’t load any mustache files.
Is this the proper way of loading mustache templates when using can-compile? Or is this a hacked approach and there’s a better way?