Local WASM bundle
import {createHighlighter, withWasmBundle} from '@lumis-sh/lumis'
import {htmlInline} from '@lumis-sh/lumis/formatters'
import {bundledLanguages} from '@lumis-sh/lumis/bundles/web'
import {bundledWasms} from '@lumis-sh/wasm-bundle-web'
import githubLight from '@lumis-sh/themes/github_light'
const languages = withWasmBundle(bundledLanguages, bundledWasms)
const hl = await createHighlighter({languages: [languages]})
await hl.loadLanguage(languages.javascript)
const html = hl.highlight(
'const theme = "github-light"',
htmlInline({language: languages.javascript, theme: githubLight})
)
See WASM and CDN for the broader loading model.