Publishing custom Stencil components

Publishing a Stencil component for use within an Ionic/Angular project is pretty straightforward, although we will need to have an NPM account for the component to be distributed.

If you don’t have an NPM account, simply go ahead and create one. It’s free to do so, although a free account doesn’t allow publishing to private repositories (this means personal NPM packages will be publicly visible and available for download).

The package.json file

To begin, we’ll make some amendments to the Stencil project’s package.json file as follows (some lines have been removed for readability):

Get hands-on with 1200+ tech skills courses.