2023-02-26 01:30

This commit is contained in:
2023-02-26 01:30:37 +09:00
commit 9a13ccbd17
122 changed files with 32148 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
---
layout: page.11ty.cjs
title: <my-element> ⌲ Install
---
# Install
`<my-element>` is distributed on npm, so you can install it locally or use it via npm CDNs like unpkg.com.
## Local Installation
```bash
npm i my-element
```
## CDN
npm CDNs like [unpkg.com]() can directly serve files that have been published to npm. This works great for standard JavaScript modules that the browser can load natively.
For this element to work from unpkg.com specifically, you need to include the `?module` query parameter, which tells unpkg.com to rewrite "bare" module specifiers to full URLs.
### HTML
```html
<script type="module" src="https://unpkg.com/my-element?module"></script>
```
### JavaScript
```html
import {MyElement} from 'https://unpkg.com/my-element?module';
```