Add instruction on how to remove ESM build

This commit is contained in:
Joseph Garrone 2020-05-26 14:09:15 +02:00
parent 07aa89e736
commit 3a12067b15
3 changed files with 50 additions and 11 deletions

View file

@ -35,18 +35,18 @@ import { myFunction } from '#{REPO_NAME}#/myFunction';
import { myObject } from '#{REPO_NAME}#/myObject';
```
## From HTML with CDN
## Import from HTML, with CDN
Expose a global (wider browser support):
Import it via a bundle that creates a global ( wider browser support ):
```html
<script src="//unpkg.com/#{REPO_NAME}#/umd_bundle.min.js"></script>
<script src="//unpkg.com/#{REPO_NAME}#/bundle.min.js"></script>
<script>
var myFunction = #{REPO_NAME_NO_DASHES}#.myFunction;
const { myFunction, myObject } = #{REPO_NAME}#;
</script>
```
Or import as an ES module:
Or import it as an ES module:
```html
<script type="module">
@ -54,6 +54,8 @@ Or import as an ES module:
</script>
```
*You can specify the version you wish to import: * [unpkg.com](https://unpkg.com)
## Contribute
```bash