With Lit 2.0 we could publish a web component to NPM and use it via a script tag like this one.
<script src="https://unpkg.com/@fireflysemantics/fs-gist"></script>
That component is from this NPM package.
This are the relevant properties in package.json
.
"main": "fs-gist.bundle.js",
"module": "fs-gist.js",
"types": "fs-gist.d.ts",
"type": "module",
I tried doing the same thing with the my-element
demo in for the Lit 3.0 Typescript starter.
This is the Github Repository for the test..
I published it to NPM under the name @fireflysemantics/wctest
. This is the package.
The relevant package.json
properties are:
"main": "my-element.bundled.js",
"module": "my-element.js",
"types": "my-element.d.ts",
"type": "module",
When I try to use the element rollup bundle over the NPM CDN it does not render. This is a stackblitz demo. Any ideas?