JSPM vs Browserify
When comparing JSPM vs Browserify, the Slant community recommends Browserify for most people. In the question“What are the best frontend JavaScript module bundlers?” Browserify is ranked 4th while JSPM is ranked 7th. The most important reason people chose Browserify is:
Using browserify opens you up to npm, that has over 80k modules of which a great amount work both client-side and server-side. And the list is growing rapidly.
Ranked in these QuestionsQuestion Ranking
Pros
Pro Registry agnostic
JSPM is registry agnostic, it can pull packages from npm and github and is built in such a way it can support more.
Pro Module style agnostic
Loads ES6, AMD, CommonJS and globals.
Pro Can transcompile ES6, JSX and Typescript
Pro Much faster than Webpack or Browserify
While Webpack and Browserify recompile the source code using Babel, jspm is the only packager that can load prebuild/minified code downloaded from the npm registry.
Pro Bundled based on imported modules without any config
Create the bundle file without config and add only the modules imported.
Pro Switch between async or sync load
With a simple command you could change between load the modules async by systemjs or sync with a bundle file.
Pro Easy install packages from npm, github or any git repository
Pro Versioned package urls
It creates a packages folders which are versioned. This makes it future proof for a time where we stop bundling all the code. In the following presentation Guy Bedford calls bundling an anti-pattern.
Pro Very easy to start with
Pro Tap into npm's huge module ecosystem
Using browserify opens you up to npm, that has over 80k modules of which a great amount work both client-side and server-side. And the list is growing rapidly.
Pro Simple to use dependency management
To require a file, just use the require() function.
var foo = require('./foo.js');
These files may have dependencies of their own. Browserify will build a dependency graph and bundle it into a single file that you just have to put in a script tag.
<html>
<body>
<script src="bundle.js"></script>
</body>
</html>
Pro Share the same modules client-side and server-side
Because browserify allows you to use the same require() function as node.js, you can easily share modules between the client-side and server-side.
Pro Provides browser-friendly shims of Node modules
Browserify provides browser-friendly shims of Node modules, that allow for things like Node event systems, path parsing, URL parsing.
Pro deAMDify & debowerify allow using modules written for other systems
Browserify includes transforms such as deAMDify, that allow you to use modules written in the AMD module format, and debowerify, that allows you to use modules intended to be managed by Bower package manager.
Pro CJS module format
Pro Friendly plugin interface
Writing plugins is relatively easy and straight forward as each file, you can run a function that gives a file name and path, based on that you can decide if you want to do something like parse, transform, modify etc the file or skip it.
Cons
Con You need to be an expert to write shims
You can load any module. But that comes with the price:
you need to find or write configs to load a particular rare module.
Con Doesn't hide complexity
JSPM doesn't try to hide complexity from the user. I.e. when some issue emerges you need understand a lot to be able to patch it or create a workaround.
Con Watcher has bugs
Watching would benefit from improvements
Con Unstable API
0.17 is still in beta. 0.16 is lacking features.
Con Poor bundler performance
Bundling performance is slow, though offset by the fact that bundling is not required during development, since it can load dependencies asynchronously.
Con Requires NodeJS environment just to get in the door
Browserify does nothing client-side. It's only a server-side builder. If you want to load files from other domains, look at RequireJS. If you want to break your code up into multiple modules, look at RequireJS or Webpack.
Con Requires a lot of magic for setup
Digging for high amount of modules