Fix shiki shim: export stubs instead of throwing
The throwing shim caused hasShikiModule() to return false, but
import('shiki') still resolved in some code paths where the module
was imported directly without the has-check, causing undefined
destructuring and the 'e.find' TypeError.
This commit is contained in:
parent
1a86f3fa16
commit
660bb3aab6
|
|
@ -1 +1,5 @@
|
|||
throw new Error('shiki is stubbed out to reduce bundle size')
|
||||
export const bundledThemesInfo: never[] = []
|
||||
export const bundledLanguagesInfo: never[] = []
|
||||
export function createHighlighter() {
|
||||
return { getLoadedLanguages: () => [], getLoadedThemes: () => [], codeToTokens: () => ({ tokens: [] }), loadLanguage: async () => {}, loadTheme: async () => {}, dispose: () => {} }
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue