diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 8e600cd..b7be833 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -33,7 +33,13 @@ "Bash(mv:*)", "Bash(git restore:*)", "Bash(git remote:*)", - "Bash(npx sharp-cli:*)" + "Bash(npx sharp-cli:*)", + "WebFetch(domain:www.googleapis.com)", + "Bash(pip --version:*)", + "Bash(pip install:*)", + "Bash(python:*)", + "Bash(pyftsubset:*)", + "Bash(NODE_TLS_REJECT_UNAUTHORIZED=0 node:*)" ], "deny": [] } diff --git a/index.html b/index.html index eb0f1fb..134d85a 100644 --- a/index.html +++ b/index.html @@ -59,63 +59,36 @@ - + diff --git a/vite.config.ts b/vite.config.ts index 5ec6157..15dc5f8 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,10 +1,26 @@ -import { defineConfig } from 'vite'; +import { defineConfig, Plugin } from 'vite'; import react from '@vitejs/plugin-react'; import { VitePWA } from 'vite-plugin-pwa'; import mdx from '@mdx-js/rollup'; import remarkFrontmatter from 'remark-frontmatter'; import remarkMdxFrontmatter from 'remark-mdx-frontmatter'; +// Plugin to make CSS non-blocking using the print media trick +function asyncCssPlugin(): Plugin { + return { + name: 'async-css', + enforce: 'post', + transformIndexHtml(html) { + // Convert blocking CSS to async loading with print media trick + return html.replace( + //g, + ` +` + ); + } + }; +} + export default defineConfig({ plugins: [ { @@ -25,6 +41,7 @@ export default defineConfig({ configFile: false, } }), + asyncCssPlugin(), VitePWA({ strategies: 'generateSW', registerType: 'autoUpdate',