Skip to content

Commit f897bb1

Browse files
committed
Loading the esm in the browser doesn't actually work
(because it can't import which-polygon)
1 parent 75f72ce commit f897bb1

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

README.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Client-side coding has a number of benefits over server-side solutions:
5858

5959
`npm install @ideditor/country-coder`
6060

61-
**country-coder** is distributed in several module formats for maxmimum compatibility. ([Read more about Javascript module formats](https://dev.to/iggredible/what-the-heck-are-cjs-amd-umd-and-esm-ikm))
61+
**country-coder** is distributed in CJS and ESM module formats for maxmimum compatibility. ([Read more about Javascript module formats](https://dev.to/iggredible/what-the-heck-are-cjs-amd-umd-and-esm-ikm))
6262

6363

6464
```js
@@ -72,17 +72,9 @@ import { iso1A2Code } from '@ideditor/country-coder'; // ESM import
7272

7373
### Use in Browsers
7474

75-
You can also use **country-coder** directly in a web browser. A good way to do this is to fetch the appropriate file from the [jsDelivr CDN](https://www.jsdelivr.com/), which can even deliver minified versions.
75+
You can also use **country-coder** directly in a web browser. A good way to do this is to fetch the ["iife"](https://esbuild.github.io/api/#format-iife) bundle from the [jsDelivr CDN](https://www.jsdelivr.com/), which can even deliver minified versions.
7676

77-
The latest versions of many web browsers now support [ES modules in script tags](https://caniuse.com/#feat=es6-module) like this:
78-
```html
79-
<script type="module">
80-
import { iso1A2Code } from 'https://cdn.jsdelivr.net/npm/@ideditor/country-coder@5.0/dist/country-coder.mjs';
81-
var result = iso1A2Code('Q145');
82-
</script>
83-
```
84-
85-
You can also load the IIFE build in a `<script>` tag - in this case you'll get a `countryCoder` global to use elsewhere in your scripts:
77+
When you load this file in a `<script>` tag, you'll get a `countryCoder` global to use elsewhere in your scripts:
8678
```html
8779
<head>
8880
<script src="https://cdn.jsdelivr.net/npm/@ideditor/country-coder@5.0/dist/country-coder.iife.min.js"></script>

0 commit comments

Comments
 (0)