This repository has been archived by the owner on Feb 7, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: introduce lazy embedded, more efficient bundle (#59)
- Loading branch information
Showing
7 changed files
with
200 additions
and
91 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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { expect, it } from 'vitest' | ||
|
||
it('bundle-full', async () => { | ||
const highlighter = await import('shikiji/bundle/full').then(r => r.getHighlighter({ | ||
langs: Object.keys(r.bundledLanguages), | ||
})) | ||
|
||
expect(highlighter.getLoadedLanguages().length) | ||
.toMatchInlineSnapshot(`233`) | ||
}) | ||
|
||
it('bundle-web', async () => { | ||
const highlighter = await import('shikiji/bundle/web').then(r => r.getHighlighter({ | ||
langs: Object.keys(r.bundledLanguages), | ||
})) | ||
|
||
expect(highlighter.getLoadedLanguages().length) | ||
.toMatchInlineSnapshot(`72`) | ||
}) |
Oops, something went wrong.