Open doowb opened 7 years ago
+1
I want to know if there's a proper way to do this. I'm requiring the whole handlebars-helpers right now, which is 3MB of stuff in my vendor.js file for some reason.
Referencing #1, I now notice that this can be done. However, is there a way to pass in my own instance of Handlebars while loading these helpers separate?
I did this, but seems to not work:
require('handlebars-helpers/lib/array.js')({ handlebars: Handlebars });
require('handlebars-helpers/lib/comparison.js')({ handlebars: Handlebars });
You would do: Handlebars.registerHelper(require('handlebars-helpers/lib/array.js'));
Each helper collection exports an object of helpers that can be registered with Handlebars directly. This is basically how the main export does it.
Create an example showing how to use browserify directly to create a standalone bundle to use in existing apps.