devpunks / snuggsi

snuggsi ツ - Easy Custom Elements in ~1kB
https://snuggsi.com
MIT License
398 stars 17 forks source link

Improvement: NPM Support & Named Imports #228

Open jlukic opened 1 year ago

jlukic commented 1 year ago

I appreciate that this is built to work out of the box in the browser, but it'd be nice if there was support for using portions of your library through named imports for more complex setups.

Currently npm install does work like

npm install devpunks/snuggsi

but there is no way to use this directly in code like

import { Element } from 'snuggsi';

Element `hello-world`

(class extends HTMLElement {

})

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import