preactjs / preact-custom-element

Wrap your component up as a custom element
MIT License
355 stars 52 forks source link

how to publish and then use my web component in other websites? #86

Closed da1z closed 3 months ago

da1z commented 4 months ago

is there any guide how to properly publish web component? to npm maybe? and then use it through embedding script ?

rschristian commented 3 months ago

No guide exists as far as I'm aware as it's no different from any other library really.

Is there anything in particular you're looking for/confused on?

da1z commented 3 months ago

No guide exists as far as I'm aware as it's no different from any other library really.

Is there anything in particular you're looking for/confused on?

yes. i want to make a component that can be used any any web page by jest embedding script tag . The question is how to setup my project to make script output ?

rschristian commented 3 months ago

Do you want a widget, or a widget and a component library?

Here's an example of a widget, it's nothing fancy: https://github.com/rschristian/demo__preact-custom-element-widget

da1z commented 3 months ago

Just widget. No component library

rschristian commented 3 months ago

Then that should do it.