umbraco-package.json importmap
# package-development
w
How do I use the importmap property on umbraco-package.json?
j
It takes in exactly the format that is defined on MDN
that is what we do in the backoffice core
you would use it if you want to expose something that other packages should be able to pick up
w
Ok I better get reading up… but sounds like for most unless your package is extensible for others then most likely won’t need this is what your saying?
Say if I was Matt with Vendr and wanted other people to extend it then he would probably want to use it.
j
Yes, Matt has extension support in Commerce, so he would most likely need to export a few things
We are using it primarily in the Core so we don't have to maintain the importmap manually. We needed to implement a way to avoid that, so we thought it might be useful to others as well, since we needed it anyway
w
Ok I won’t spend too much time reading/learning about it for now then until or if I ever need it
j
regarding extensions; any package can provide contexts on the root element to be consumed by anyone else, so you don't strictly need to inject something into the importmap
5 Views