@@ -17,29 +17,30 @@ description: Web Components API reference
1717## Loading From a CDN (No Bundler)
1818
1919For quick demos or embeds on a static page, both ` @moq/watch ` and
20- ` @moq/publish ` can be loaded straight from jsDelivr with no build step.
21- Appending ` /+ esm` to the URL tells jsDelivr to transform the file and
22- rewrite bare imports (like ` @moq/hang ` , ` @moq/net ` ) to other ` + esm`
23- URLs, so it loads in the browser without an import map:
20+ ` @moq/publish ` can be loaded straight from [ esm.sh ] ( https://esm.sh ) with no
21+ build step. esm.sh serves each package as a browser-ready ESM module and
22+ rewrites bare imports (like ` @moq/hang ` , ` @moq/net ` ) to other esm.sh URLs, so
23+ it loads in the browser without an import map:
2424
2525``` html
2626<script type =" module" >
27- import " https://cdn.jsdelivr.net/npm/ @moq/watch/element.js/+esm " ;
28- import " https://cdn.jsdelivr.net/npm/ @moq/publish/element.js/+esm " ;
27+ import " https://esm.sh/ @moq/watch/element" ;
28+ import " https://esm.sh/ @moq/publish/element" ;
2929 </script >
3030
3131<moq-watch url =" https://relay.example.com/anon" name =" room/alice.hang" >
3232 <canvas ></canvas >
3333</moq-watch >
3434```
3535
36- Pin a version range in the URL for production — e.g.
37- ` https://cdn.jsdelivr.net/npm/@moq/watch@0.2/element.js/+esm ` . [ esm.sh] ( https://esm.sh )
38- (` https://esm.sh/@moq/watch/element ` ) works the same way if you prefer it.
36+ Pin a version range in the URL for production, e.g.
37+ ` https://esm.sh/@moq/watch@0.2/element ` . jsDelivr's ` +esm ` endpoint
38+ (` https://cdn.jsdelivr.net/npm/@moq/watch/element.js/+esm ` ) works the same way
39+ if you prefer it.
3940
4041This is the fastest way to try MoQ in a blog post or demo page, but for
4142real apps you should [ install the packages] ( #available-components ) and
42- use a bundler — you 'll get tree-shaking, offline dev, and no dependency
43+ use a bundler. You 'll get tree-shaking, offline dev, and no dependency
4344on a third-party CDN's availability.
4445
4546## Available Components
0 commit comments