Support loading aliases
atinux opened this issue · 3 comments
atinux commented
Example:
export default defineNuxtConfig({
shiki: {
langs: ['bash']
}
})
[nitro 7:47:12 PM] ERROR Error: Could not load /Users/atinux/my-project/node_modules/.pnpm/shiki@1.1.5/node_modules/shiki/dist/langs/bash.mjs
It would be nice to detect that it is an alias and load the corresponding language: powershell
(See https://github.com/shikijs/shiki/blob/b9c0fb5fcc0c86d0e994ac0a51d990a9270a73f3/packages/shiki/src/assets/langs-bundle-full.ts#L834-L841)
Any hint on how to do this @antfu ?
antfu commented
Here is how I did in mdc module:
I don't mind creating stub modules for alias to be directly imported - but that might not work for every alias as not all aliases a valid ansi filenames - I will try
antfu commented
shikijs/shiki#596 get merged - now this should just work if you upgrade shiki to 1.1.6