Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ije committed Nov 4, 2021
1 parent cbc9255 commit 90ee314
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@ import Daygrid from 'https://esm.sh/@fullcalendar/daygrid'

This only works when the NPM module imports css files in JS directly.


## Web Worker

esm.sh supports `?worker` mode to load modules as web worker:

```javascript
import editorWorker from '/monaco-editor/esm/vs/editor/editor.worker?worker'

const worker = new editorWorker()
```

## Deno compatibility

**esm.sh** will resolve the node internal modules (**fs**, **child_process**, etc.) with [`deno.land/std/node`](https://deno.land/std/node) to support some packages working in Deno, like `postcss`:
Expand All @@ -117,6 +128,14 @@ You can pass the `no-check` query to disable the `X-TypeScript-Types` header if
import unescape from 'https://esm.sh/lodash/unescape?no-check'
```

## Pin the build version

Since we update esm.sh server very frequently, sometime we may break some packages that work fine previously by mistake, because we need to rebuild all modules when the patch pushed. To avoid this, you can pin the build version by the `?pin=BUILD_VERSON` query.

```javascript
import React from 'https://esm.sh/[email protected]?pin=v57'
```

## Network of esm.sh

- Main server in HK
Expand Down

0 comments on commit 90ee314

Please sign in to comment.