Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(vite): update SvelteKit entry and the example (#1237)
- Loading branch information
Showing
5 changed files
with
69 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { sveltekit } from '@sveltejs/kit/vite' | ||
import UnoCss from 'unocss/vite' | ||
import { extractorSvelte } from '@unocss/core' | ||
import presetIcons from '@unocss/preset-icons' | ||
import presetUno from '@unocss/preset-uno' | ||
import { FileSystemIconLoader } from '@iconify/utils/lib/loader/node-loaders' | ||
|
||
/** @type {import('vite').UserConfig} */ | ||
const config = { | ||
plugins: [ | ||
sveltekit(), | ||
UnoCss({ | ||
extractors: [extractorSvelte], | ||
shortcuts: [ | ||
{ logo: 'i-logos:svelte-icon w-6em h-6em transform transition-800 hover:rotate-180' }, | ||
{ foo: 'bg-yellow-400' }, | ||
{ bar: 'bg-green-400' }, | ||
], | ||
presets: [ | ||
presetUno(), | ||
presetIcons({ | ||
collections: { | ||
custom: { | ||
// do not remove LF: testing trimCustomSvg on universal icon loader | ||
circle: `<svg viewBox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> | ||
<circle cx="60" cy="60" r="50"/> | ||
</svg> | ||
`, | ||
}, | ||
customfsl: FileSystemIconLoader( | ||
'./icons', | ||
svg => svg.replace('<svg ', '<svg fill="currentColor" '), | ||
), | ||
}, | ||
extraProperties: { | ||
'display': 'inline-block', | ||
'vertical-align': 'middle', | ||
}, | ||
}), | ||
], | ||
}), | ||
], | ||
} | ||
|
||
export default config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters