When comparing JSPM vs Webpack, the Slant community recommends Webpack for most people. In the question“What are the best frontend JavaScript module bundlers?” Webpack is ranked 1st while JSPM is ranked 7th. The most important reason people chose Webpack is:
Plugins and loaders are easy to write and allow you to control each step of the build, from loading and compiling CoffeeScript, LESS and JADE files to smart post processing and asset manifest building.
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 Rich and flexible plugin infrastructure
Plugins and loaders are easy to write and allow you to control each step of the build, from loading and compiling CoffeeScript, LESS and JADE files to smart post processing and asset manifest building.
Pro Tap into npm's huge module ecosystem
Using Webpack 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 Can create a single bundle or multiple chunks loaded on demand, to reduce initial loading time
Webpack allows you to split your codebase into multiple chunks. Chunks are loaded on demand. This reduces the initial loading time.
Pro Supports source maps for easier debugging
Source maps allow for easier debugging, because they allow you to find the problems within the origin files instead of the output file.
Pro ES6 module support
Webpack supports ES6 modules and their import
and export
methods without having to compile them to CommonJS require
Pro Share the same modules client-side and server-side
Because Webpack allows you to use the same require() function as node.js, you can easily share modules between the client-side and server-side.
Pro Bundles CommonJs and AMD modules (even combined)
Webpack supports AMD and CommonJS module styles. It performs clever static analysis on the AST of your code. It even has an evaluation engine to evaluate simple expressions. This allows you to support most existing libraries.
Pro Mix ES6 AMD and CommonJS
Webpack supports using all three module types, even in the same file.
Pro Limit plugin integration issues
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 Config file may be hard to understand
Due to a somewhat hard to grasp syntax, configuring Webpack may take some time.