I have a Stencil component using its own assets (images). After I build and publish to npm and install the package in my React app, the assets in the Stencil component won’t work anymore. React tries to find them in the public folder but they are not there: they are located at node_modules\stencil_project_name\dist.
Question: What’s the correct workflow to handle this situation?
It’s very late, 1.5 year late, and I don’t know if you guys found the solution, but I recently faced this. Thought I could help someone who stumbles upon this query.
Not just Stencil components, but in any Node module, you need to copy the assets from your package to the application that uses the package. Meaning if you have a Vue application that uses a Stencil component library as a Node package, you need to write a ‘copy’ task in your Vue application that will copy the images from this package, and put them into its own public or assets directory.