-
-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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`: | ||
|
@@ -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 | ||
|