metonym / svelte-highlight

Syntax Highlighting for Svelte using highlight.js
https://svhe.onrender.com
MIT License
253 stars 13 forks source link

Cant import styles that have two words in the title. #296

Closed TristanBrotherton closed 11 months ago

TristanBrotherton commented 11 months ago

I'm in a odd pickle. Wonder if anyone has any insight. In my code if I do this: import lightStyles from 'svelte-highlight/styles/github';

Everything works as expected. But I can not import any styles that have two words in the title. So if I try and do this:

import darkStyles from 'svelte-highlight/styles/githubDark';

Vite fails with an error of: [plugin:vite:import-analysis] Missing "./styles/githubDark" specifier in "svelte-highlight" package

I can see all the files there, i just can't figure out what it doesn't like.

metonym commented 11 months ago

The file name of the style is dash-separated.

- import githubDark from "svelte-highlight/styles/githubDark";
+ import githubDark from "svelte-highlight/styles/github-dark";

See the docs for more examples: https://svhe.onrender.com/styles

TristanBrotherton commented 11 months ago

I'm sorry I missed that. Thank you for taking the time to respond!