vaheqelyan / svelte-grid

A responsive, draggable and resizable grid layout, for Svelte.
https://svelte-grid.now.sh/
MIT License
948 stars 57 forks source link

How to use it as "vanillajs" library? #116

Closed CodeFetch closed 1 year ago

CodeFetch commented 2 years ago

I'd like to build it as a library which I can use in non-Svelte projects. How is this possible? Currently I'm writing a wrapper for achieving this, but maybe I'm just too stupid and there is an easier way?!

vaheqelyan commented 2 years ago

i guess the only option is to build a web component

this may help you: https://svelte.dev/docs#run-time-custom-element-api

Personally i have never tried to compile a svelte component to a web component. There are few articles on this topic, you can do you own research.

I am not 100% sure, that you will succeed by doing this, because right now svelte has few issues with web-components

This article explains things really good https://javascript.plainenglish.io/can-you-build-web-components-with-svelte-3c8bc3c1cfd8