Basically all you have to do is npm install
(or npm link
) the project and import it.
As far as I know there are two places you can include the import:
- Inside a global
app.ts
which is configured as a globalScript
in stencil.config.ts
.
- Inside the root component.
In your case the second option probably won't work since component libraries usually don't have a root component.
Import inside app.ts
:
First, create a global script and configure it in your stencil.config.ts
:
export const config: Config = {
// ...
globalScript: 'src/global/app.ts',
};
Then add the import inside that file. Example for Ionic Framework:
import '@ionic/core';
Now you can use the components just like any other HTML element.