blue
View on GitHub

Getting Started

Prerequisites

Installation

 git clone https://github.com/imohanvadivel/desk-ext-template.git
 cd desk-ext-template
 npm i

Configuring the SVG loader

 npm i -D vite-svg-loader
// vite.config.ts
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import svgLoader from 'vite-svg-loader';

export default defineConfig({
	plugins: [sveltekit(), svgLoader({ defaultImport: 'raw' })]
});

Seeing file paths instead of icons?

Without svgLoader({ defaultImport: 'raw' }) , Vite resolves each icon import to a URL string instead of the SVG markup, and the components render that string as visible text over their own content. Buttons, chips, empty states and anything else carrying an icon end up garbled with fragments such as /node_modules/deskblocks/dist/icons/source/Account.svg printed into the page.

This fails silently: there is no build error and nothing is logged to the browser console. If your icons look like broken text, check this configuration first.

Testing

 # Starts the server on port 5000
 npm run dev

Note:

The first time you run the server, you may need to grant sudo permissions to generate a TLS certificate because the development server runs over HTTPS.

Bundling

 # Bundles the project and generates a zip file in the dist folder
 npm run build

Miscellaneous

<img src="assets/img.png" />

Additional Resources