Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
],
"sideEffects": false,
"type": "module",
"exports": "./index.js",
"exports": {
".": "./index.js",
"./lib/*": "./lib/*"
},
"files": [
"lib/",
"index.d.ts",
Expand Down
9 changes: 9 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ In browsers with [`esm.sh`][esmsh]:
</script>
```

This will however always bring in every language because most CDNs do not support treeshaking. If you would like to only import the "common" languages you can do the following:

```html
<script type="module">
import {createLowlight} from 'https://esm.sh/lowlight@3/lib/index.js'
import {grammars as common} from 'https://esm.sh/lowlight@3/lib/common.js'
</script>
```

## Use

```js
Expand Down