最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Is the UMD format interchangeable with ESM for Web Components served over CDNs? - Stack Overflow

programmeradmin2浏览0评论

The current Lit element starter projects rollup builds publish the bundles in esm format.

I'd like to switch out the rollup build with Vite, and the Vite Library builds output UMD format.

Can we switch out esm format with UMD format?

Is there anything that esm does that we cannot do with UMD?

For example with the current Lit builds we can use a component published to NPM like this via the UNPKG CDN.

<script
      type="module"
      src=";
></script>

Can we do the same thing with UMD?

Are there any differences as far as regular imports go. For example with esm we can do import { ExampleComponent } from "example-component". Is it the same with UMD?

发布评论

评论列表(0)

  1. 暂无评论