Could you provide an example of using lit-html from CDN please
Perhaps you can add umd minfied output to build?
You can import it from a <script type=module>:
import { html, render } from 'https://unpkg.com/[email protected]/lit-html.js'
That since Safari, Chrome and Edge do support modules ✨
Would it not be preferable to have a babelified minified version that can be used by more browsers to play with?
module seems very new
I think "babelifying" it's of users land. Like when you add polyfills and that sort of thing.
I think that the way lit-html is distributed is the right way, but maybe a minified version could be handy.
It is your project, I think it just does not lend itself well to people sharing code on code pen:
Observe: https://codepen.io/kenbrown/pen/xXjQoZ
How the code must be put in html
It looks worse on jsfiddle
Not to mention browsers without type=module
You can only provide styles in lit-html using
@richardanaya I modified your pen on codepen here:
But how to import directives that way?
import { html, render, guard } from 'https://unpkg.com/lit-html?module'; // complains guard not found
import { guard } from 'https://unpkg.com/lit-html/directives/guard.js?module';
Most helpful comment
You can import it from a
<script type=module>:That since Safari, Chrome and Edge do support modules ✨