- unplugin-icons + @iconify-json/lucide for compile-time icon bundling - Toolbar: proper cursor, frame, square, pen, type, hand icons - Layers panel: per-type node icons + chevron-right for expand/collapse - Remove icon field from ToolDef (icons mapped in components)
43 lines
975 B
TypeScript
43 lines
975 B
TypeScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import Icons from 'unplugin-icons/vite'
|
|
import { copyFileSync, existsSync } from 'fs'
|
|
|
|
// @ts-expect-error process is a nodejs global
|
|
const host = process.env.TAURI_DEV_HOST
|
|
|
|
export default defineConfig(async () => ({
|
|
plugins: [
|
|
{
|
|
name: 'copy-canvaskit-wasm',
|
|
buildStart() {
|
|
const src = 'node_modules/canvaskit-wasm/bin/canvaskit.wasm'
|
|
const dest = 'public/canvaskit.wasm'
|
|
if (existsSync(src) && !existsSync(dest)) {
|
|
copyFileSync(src, dest)
|
|
}
|
|
}
|
|
},
|
|
tailwindcss(),
|
|
Icons({ compiler: 'vue3' }),
|
|
vue()
|
|
],
|
|
clearScreen: false,
|
|
server: {
|
|
port: 1420,
|
|
strictPort: true,
|
|
host: host || false,
|
|
hmr: host
|
|
? {
|
|
protocol: 'ws',
|
|
host,
|
|
port: 1421
|
|
}
|
|
: undefined,
|
|
watch: {
|
|
ignored: ['**/desktop/**']
|
|
}
|
|
}
|
|
}))
|