11import { defineConfig } from 'vitepress' ;
22import tailwindcss from '@tailwindcss/vite' ;
3+ import { visualizer } from 'rollup-plugin-visualizer' ;
34
45export default defineConfig ( {
56 vite : {
6- plugins : [ tailwindcss ( ) ] ,
7+ plugins : [
8+ tailwindcss ( ) ,
9+ // Bundle analyzer - generates stats.html after build
10+ visualizer ( {
11+ filename : '.vitepress/dist/stats.html' ,
12+ open : false ,
13+ gzipSize : true ,
14+ brotliSize : true ,
15+ } ) ,
16+ ] ,
17+ } ,
18+
19+ // Configure Shiki for minimal bundle size
20+ // See: https://shiki.style/guide/bundles
21+ markdown : {
22+ theme : {
23+ light : 'github-light' ,
24+ dark : 'github-dark' ,
25+ } ,
726 } ,
827
928 appearance : true , // Enable dark mode toggle
@@ -14,10 +33,20 @@ export default defineConfig({
1433 cleanUrls : true ,
1534
1635 head : [
17- // Preconnect for faster font loading
36+ // Preconnect for faster resource loading
1837 [ 'link' , { rel : 'preconnect' , href : 'https://fonts.googleapis.com' } ] ,
1938 [ 'link' , { rel : 'preconnect' , href : 'https://fonts.gstatic.com' , crossorigin : '' } ] ,
2039 [ 'link' , { rel : 'preconnect' , href : 'https://api.iconify.design' } ] ,
40+ [ 'link' , { rel : 'preconnect' , href : 'https://flow.demo.vyuh.tech' } ] ,
41+ // Non-blocking font loading (moved from CSS @import for better performance)
42+ [ 'link' , {
43+ rel : 'stylesheet' ,
44+ href : 'https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400&family=Montserrat:wght@400;600;800;900&display=swap' ,
45+ media : 'print' ,
46+ onload : "this.media='all'"
47+ } ] ,
48+ // Fallback for browsers with JS disabled
49+ [ 'noscript' , { } , '<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400&family=Montserrat:wght@400;600;800;900&display=swap">' ] ,
2150 [ 'link' , { rel : 'icon' , href : '/icon.svg' , type : 'image/svg+xml' } ] ,
2251 [ 'meta' , { property : 'og:type' , content : 'website' } ] ,
2352 [ 'meta' , { property : 'og:title' , content : 'Vyuh Node Flow - Visual Flow Editor for Flutter' } ] ,
0 commit comments