I am using Browserify and Grunt to bundle our RendrJS webapp. I would like to analyze the bundle to see which modules it contains to see if any code is superfluous. This can happen since in Rendr some js code might only run on the server.
How do I get a list of the contents of the bundle. I have tried:
browserifyOptions: { 'list': true }
but it doesn't seem to have any effect. We are using Browserify 2.
Use a node-style require() to organize your browser code and load modules installed by npm. browserify will recursively analyze all the require() calls in your app in order to build a bundle you can serve up to the browser in a single <script> tag.
Consequently, Browserify isn't as much a module loader as a module bundler: Browserify is entirely a build-time tool, producing a bundle of code which can then be loaded client-side.
Browserify makes it possible to use node modules directly in the browser. It integrates well with npm and allows you to bundle your JavaScript dependencies into one file that can be referenced within a <script> tag.
Browserify is an open-source JavaScript bundler tool that allows developers to write and use Node. js-style modules that compile for use in the browser.
Saw your question, dug up a tiny old script and just now pushed browserify-inspect-bundle to npm, grab it here:
https://www.npmjs.com/package/browserify-inspect-bundle
Usage is:
npm install -g browserify-inspect-bundle
browserify-inspect-bundle /path/to/your/bundle.js
This should get you something useful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With