Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide local filenames in Browserify output?

Tags:

browserify

When you bundle your code with Browserify, each module you use is inlined in the resulting output and labeled with its local file path. So you can see file path strings in your bundled code.

But in theory, these strings could all be rewritten to "1", "2", etc, which might be a security advantage in some situations (and would save a few bytes).

Is there any option for this, or some transform that will do it? (It would have to rewrite the labels for each inlined module, and all the corresponding require calls.)

like image 444
callum Avatar asked Dec 03 '25 05:12

callum


1 Answers

Seems that 6 months after your question, Browserify's author James Halliday put Bundle Collapser out there. It does pretty much exactly what we were both after.

like image 82
Andri Möll Avatar answered Dec 05 '25 08:12

Andri Möll



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!