News for hackers. Stuff that matters.
Re:Writing JavaScript without a build system by TimTheTinker on Thursday February 16, 2023 @08:22PM (#34829411)
Looks like you need a <script type="importmap"> -- it could map 'lit' to the CDN hosted version or to a relative path.

More info: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sc...

Re:Writing JavaScript without a build system by mtlynch on Thursday February 16, 2023 @08:25PM (#34829438)
Ah, thanks! I'd never encountered these before.

It seems like a handy way to make my code match the code in documentation that assumes a Node environment.

Re:Writing JavaScript without a build system by TimTheTinker on Thursday February 16, 2023 @08:42PM (#34829562)
No problem! There's also a polyfill if you need to support Safari:

https://github.com/guybedford/es-module-shims

Re:Writing JavaScript without a build system by chrisehlee on Saturday February 18, 2023 @12:42AM (#34844265)
Thankfully iOS 16.4 will be natively supporting import maps so fingers crossed this might be easier soon

https://webkit.org/blog/13878/web-push-for-web-apps-on-ios-a...