4 ms·
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
by TimTheTinker 4y ago
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/script/type/importmap https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sc...
- mtlynch 4y agoAh, 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.
- TimTheTinker 4y agoNo problem! There's also a polyfill if you need to support Safari: https://github.com/guybedford/es-module-shims https://github.com/guybedford/es-module-shims
- chrisehlee 4y agoThankfully 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-and-ipados/ https://webkit.org/blog/13878/web-push-for-web-apps-on-ios-a...