14

I'm new to jspm, transitioning from npm-only. I have one fundamental question. I have some dependencies in the package.json, and I runned jspm init, which created a nice jspm config.js file. My question is, what it the point of installing these packages from jspm (via jspm install ...)? Why not just install them through npm?

More specifically, in my package.json, what's the difference between putting these packages inside dependencies: {} vs inside jspm.dependencies: {}

jeanpaul62
  • 9,451
  • 13
  • 54
  • 94

1 Answers1

4

Assuming that you are building a webapp jspm is more suitable for managing your frontend dependencies than npm. I think for a webapp npm only makes sense when used together with browserify. One key benefit of jspm is that you can load your dependencies using SystemJS & the ES6 Module Loader Polyfill. This enables you to load the dependencies in the browser using the ES6 module syntax. E.g.:

import 'jquery';

Keep in mind that jspm is ment to be used for your frontend dependencies. For your dependencies used for the build process you should keep using npm.

brass monkey
  • 5,841
  • 10
  • 36
  • 61
  • 7
    I can load npm packages with SytemJS too no? That's what I'm currently doing with angular2: https://angular.io/docs/ts/latest/quickstart.html#!#systemjs, it's systemJS without jspm. – jeanpaul62 May 10 '16 at 12:14