Skip to content

Commit

Permalink
Improve ESM Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
wesbos authored Dec 7, 2023
1 parent da0b515 commit c22049a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,22 @@ npm install @oddbird/popover-polyfill
After installing, you’ll need to use appropriate tooling to use
`node_modules/@oddbird/popover-polyfill/dist/popover.js`.

For most tooling such as Vite, Webpack, and Parcel, that will look like this:

```js
import '@oddbird/popover-polyfill;
```
If you want to manually apply the polyfill, you can instead import the
`isSupported` and `apply` functions directly from
`node_modules/@oddbird/popover-polyfill/dist/popover-fn.js` file.
With most tooling:
```js
import { apply, isSupported } from '@oddbird/popover-polyfill/fn';
```
### Via CDN
For prototyping or testing, you can use the npm package via a Content Delivery
Expand Down

0 comments on commit c22049a

Please sign in to comment.