I've created a stenciljs webcomponents using the starter project, and I'm trying to grab it into another stenciljs project, via package.json
dependecy, which points to a git repo.
The webcomponent is imported in, but as soon as I try to run the component inside a tsx stenciljs project, I noticed the following:
- the props are not passed in, the css I can see it being applied, but the content is missing
- if I add something extra on the page, like a character or something, the dev server renders the webcomponent (also tried building the project, same behavior)
- the webcomponent also contains some
.svgs
pushed into.tsx
files into return statement, even after adding a character on the page, those icons still don't render
Not sure if Im doing something wrong here, weird enough is that as soon as I add something else on the page, besides that webcomponent, it kinda renders correctly.
I'm importing the webcomponent into a component inside the stenciljs project via:
import 'my-component-from-git'
<-- points to the webcomponent folder in node_modules folder
stenciljs webcomponent config:
plugins: [
sass()
],
namespace: 'my-component',
outputTargets: [
{
type: 'dist',
esmLoaderPath: '../loader',
},
{
type: 'dist-custom-elements-bundle',
},
{
type: 'docs-readme',
},
{
type: 'www',
serviceWorker: null, // disable service workers
},
],
stenciljs project config:
globalStyle: 'src/global/app.css',
globalScript: 'src/global/app.ts',
taskQueue: 'async',
plugins: [
sass()
],
outputTargets: [
{
type: 'www',
// comment the following line to disable service workers in production
serviceWorker: null,
baseUrl: './../',
},
],
src/global/app.ts
. – Thomas