Skip to content

Commit

Permalink
Merge pull request #161 from wesbos/patch-1
Browse files Browse the repository at this point in the history
Improve ESM Documentation
  • Loading branch information
jgerigmeyer authored Dec 7, 2023
2 parents cb911a5 + 272ff31 commit 8db6aa1
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 8db6aa1

Please sign in to comment.