diff --git a/bun.lockb b/bun.lockb index 7592224..fca191c 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 62033d4..18f5732 100644 --- a/package.json +++ b/package.json @@ -21,13 +21,14 @@ "webcola": "^3.4.0" }, "devDependencies": { - "prettier-plugin-organize-imports": "^4.1.0", "@types/leaflet": "^1.9.14", "@types/node": "^22.10.1", "@webgpu/types": "^0.1.51", "bun-types": "^1.1.38", "mitata": "^1.0.20", + "prettier-plugin-organize-imports": "^4.1.0", "typescript": "^5.7.2", - "vite": "^6.0.3" + "vite": "^6.0.3", + "vite-plugin-mkcert": "^1.17.6" } } \ No newline at end of file diff --git a/vite.config.ts b/vite.config.ts index 544b65f..5861837 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,6 +1,7 @@ -import { resolve } from 'node:path'; import { readdirSync } from 'node:fs'; +import { resolve } from 'node:path'; import { defineConfig, IndexHtmlTransformContext, Plugin } from 'vite'; +import mkcert from 'vite-plugin-mkcert'; const canvasWebsiteDir = resolve(__dirname, './website/canvas'); @@ -16,19 +17,22 @@ const linkGenerator = (): Plugin => { const files = getCanvasFiles(); // First, handle ungrouped files const ungroupedFiles = files.filter( - (file) => !file.includes('index') && !file.startsWith('_') && !file.match(/^\[([^\]]+)\]/) + (file) => !file.includes('index') && !file.startsWith('_') && !file.match(/^\[([^\]]+)\]/), ); // Then handle grouped files const groups = files .filter((file) => !file.includes('index') && file.match(/^\[([^\]]+)\]/)) - .reduce((acc, file) => { - const match = file.match(/^\[([^\]]+)\](.+)\.html$/); - const group = match![1]; - if (!acc[group]) acc[group] = []; - acc[group].push(file); - return acc; - }, {} as Record); + .reduce( + (acc, file) => { + const match = file.match(/^\[([^\]]+)\](.+)\.html$/); + const group = match![1]; + if (!acc[group]) acc[group] = []; + acc[group].push(file); + return acc; + }, + {} as Record, + ); // Generate ungrouped HTML first const ungroupedHtml = ungroupedFiles @@ -72,16 +76,19 @@ export default defineConfig({ '@propagators': resolve(__dirname, './propagators'), }, }, - plugins: [linkGenerator()], + plugins: [linkGenerator(), mkcert()], build: { target: 'esnext', rollupOptions: { input: { index: resolve(__dirname, './website/index.html'), - ...getCanvasFiles().reduce((acc, file) => { - acc[`canvas/${file.replace('.html', '')}`] = resolve(canvasWebsiteDir, file); - return acc; - }, {} as Record), + ...getCanvasFiles().reduce( + (acc, file) => { + acc[`canvas/${file.replace('.html', '')}`] = resolve(canvasWebsiteDir, file); + return acc; + }, + {} as Record, + ), }, }, modulePreload: { diff --git a/website/canvas/event-propagators-with-device-gravity.html b/website/canvas/event-propagators-with-device-gravity.html index 9493469..c245d4b 100644 --- a/website/canvas/event-propagators-with-device-gravity.html +++ b/website/canvas/event-propagators-with-device-gravity.html @@ -53,7 +53,7 @@ expression="textContent: to.textContent + '!'" > - + >