pi0 / nuxt-shiki

🎨 Nuxt + Shiki syntax highlighter
80 stars 2 forks source link

Function-type arguments passed into module options will be erased #36

Open KazariEX opened 7 months ago

KazariEX commented 7 months ago

Since JSON.stringify() does not allow the inclusion of function types, it renders any transformers used with it ineffective.

// module.ts
export const shikiOptions = {
  highlight: ${JSON.stringify(highlightOptions, null, 2)},
  // ...
};
KazariEX commented 7 months ago

unjs/knitwork#61

KazariEX commented 7 months ago

I think a util can be provided to inject global transformers into highlightOptions at runtime.