helpers / handlebars-helpers

188 handlebars helpers in ~20 categories. Can be used with Assemble, Ghost, YUI, express.js etc.
http://assemble.io/helpers/
MIT License
2.22k stars 364 forks source link

Browserify require adds an additional 3MB to the JS file regardless of what arguments / parameters I pass. #280

Closed bs-thomas closed 7 years ago

bs-thomas commented 7 years ago

I'm trying to build and minify together handlebars-helpers, and some other vendor stuff into one big file.

However, I noticed that no matter what arguments I pass into require() using Browserify, it includes 3MB on top of my JS file.

(a) Currently I'm doing this:

require('handlebars');
require('handlebars-helpers')({ handlebars: Handlebars });

(b) I also tried

require('handlebars');
require('handlebars-helpers')(['array', 'comparison'], { handlebars: Handlebars });

and it has no almost difference.

(c) Even when I do this, it still includes 3MB

require('handlebars');
require('handlebars-helpers')([], { handlebars: Handlebars });

With (c), my custom JS stuff crashes because it says helpers are not found. I would assume they have not been included. However, why would the filesize but still that big?

(Note that I haven't minified or uglified anything yet, but 3MB is big even for something that is uncompressed).

If someone would shed me some light in terms of what's happening, I'd be grateful.

I Google'd for a long time and nobody seemed to be complaining about the file size issue, so I assume this only happens to me?

Thanks in advance!

jonschlinkert commented 7 years ago

this is probably a more appropriate question for stackoverflow. I'm going to close since we try to keep the issues focused on bug reports and feature requests, and stackoverflow is a much better place for support since it's more likely to be viewed by devs who get street cred for answering.

But it's totally ok that you created the issue, and I'd encourage you to link back to this issue if you do create the stackoverflow question. that way we'll have the answer in both places. thanks!

bs-thomas commented 7 years ago

Understood, and thanks.

jonschlinkert commented 7 years ago

no worries, I hope you find the answer, and would love it if you share it here. thanks!