Utilizing Lit 2.0, we were able to release a web component to npm and integrate it using a script tag similar to this example:
<script src="https://unpkg.com/@fireflysemantics/fs-gist"></script>
The specific component is part of this package.
Below are the pertinent properties found in the package.json
:
"main": "fs-gist.bundle.js",
"module": "fs-gist.js",
"types": "fs-gist.d.ts",
"type": "module",
I attempted a similar approach with the my-element
demo within the Lit 3.0 TypeScript starter.
Here is the GitHub repository link for testing purposes: This. It was published on npm under the name @fireflysemantics/wctest
.
The relevant properties in the package.json
file include:
"main": "my-element.bundled.js",
"module": "my-element.js",
"types": "my-element.d.ts",
"type": "module",
However, when attempting to utilize the element rollup bundle via the npm CDN, it fails to render correctly: StackBlitz.
Any suggestions or insights on this issue?