Often time you will want to link to a package to Cornerstone3D, this might be to develop a feature, to debug a bug or for other reasons.
For instance, you find a bug in the rendering of the color images in
cornerstone3D, digging deeper into the code you can find you need to debug
cornerstone-wado-image-loader as the RGB images are decoded there. In order
to do so, you need to link a local development version of 'cornerstone-wado-image-loader'
cornerstone3D package, and put your
debugger in the
There are various ways to link to a package. The most common way is to use
yarn link. In the following examples,
we assume we want to link the
cornerstone-wado-image-loader package to our
// inside cornerstone-wado-image-loader
// inside cornerstone3D (at the root - not the packages)
yarn link cornerstone-wado-image-loader
However, this is not enough. We need to tell the
to build so that your changes to the source code are reflected/used in
cornerstone-wado-image-loader to build, you can run
yarn build. However,
it will take a while to build the package.
comes with various webpack configurations, you can use/run the
yarn webpack:dynamic:watch at the root of
force the reflected changes to be built again which is faster than
and it also watches for changes to the source code and rebuilds the package.
yarn linkis actually a symlink between packages. If your linking is not working, check out the
Cornerstone3Ddirectory to see if the symlink has been created (the updated source code - not the dist - is available in the
debuggeris not hitting, you might want to change the
modesetting in the webpack to be
production. This ensures, minification is not applied to the source code.
Use a more verbose source map for debugging. You can read more here