When developing multiple packages locally, jspm link allows these local packages to be made available for installation through jspm.

There are some differences to standard linking workflows when linking with jspm, so its advisable to read these notes carefully.

Linked packages are linked into a full registry, package and version name like github:my/[email protected]. Ideally this is the registry name that will be published so that linked packages can be replaced with their published counterparts easily.

  cd my-local-package
  jspm link github:my/[email protected]
ok   Package linked.

If you include the name, registry and version properties in the package.json, we don't need to provide the name when using jspm link:

  "name": "my/repo",
  "version": "dev",
  "registry": "github"
  jspm link
ok   Package linked.

Note that because registries apply arbitrary build operations to packages, and jspm also does some build operations, every code change to the local package requires jspm link be run again from that folder. A watch task could be set up to manage this, an issue for creating this project is being tracked at https://github.com/jspm/jspm-cli/issues/481.

When linking over an existing package, jspm will ask to confirm the relink. Because this is a common workflow, it is advisable to use:

  jspm link github:my/[email protected] -y

to auto-confirm this prompt.

  cd my-jspm-app
  jspm install --link github:my/[email protected]

The linked package will be symlinked into jspm_packages, and its dependencies will be installed down the tree.

If linking packages that depend on eachother, start with the lowest in the dependency tree first.

If the package doesn't yet belong to a registry, it is also possible to link into the jspm registry itself with a name like jspm link jspm:[email protected]. Then this can be installed with jspm install --link [email protected].

  jspm install --unlink github:my/[email protected]

This will then replace the symlinked package with an installed version from the original repo on GitHub, undoing the linking operation.