4436877e45
Add a Vite plugin that renders bio, links and greetings from the Task 2 content modules into the raw served index.html at build time, so non-JS clients (Mastodon's rel=me verifier included) see real content and the mastodon.saillant.cc/@clement rel=me anchor. Hide the fallback for sighted users once the 3D demo boots, but keep it in the accessibility tree. Add @types/node so tsc can type-check the node:fs import in the new test.
15 lines
366 B
TypeScript
15 lines
366 B
TypeScript
import { defineConfig, type Plugin } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import { renderFallbackHtml } from './src/fallback/inject'
|
|
|
|
function fallbackPlugin(): Plugin {
|
|
return {
|
|
name: 'inject-fallback',
|
|
transformIndexHtml: (html) => renderFallbackHtml(html),
|
|
}
|
|
}
|
|
|
|
export default defineConfig({
|
|
plugins: [react(), fallbackPlugin()],
|
|
})
|