Prerender with Puppeteer

This commit is contained in:
Alex Gleason 2025-06-09 21:38:19 -05:00
parent 87d3cfb2eb
commit 1983126de9
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
3 changed files with 2331 additions and 5 deletions

2321
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -69,6 +69,8 @@
"@eslint/js": "^9.9.0", "@eslint/js": "^9.9.0",
"@html-eslint/eslint-plugin": "^0.41.0", "@html-eslint/eslint-plugin": "^0.41.0",
"@html-eslint/parser": "^0.41.0", "@html-eslint/parser": "^0.41.0",
"@prerenderer/renderer-puppeteer": "^1.2.4",
"@prerenderer/rollup-plugin": "^0.3.12",
"@tailwindcss/typography": "^0.5.15", "@tailwindcss/typography": "^0.5.15",
"@testing-library/jest-dom": "^6.6.3", "@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.3.0", "@testing-library/react": "^16.3.0",

View File

@ -1,5 +1,6 @@
import path from "node:path"; import path from "node:path";
import prerender from "@prerenderer/rollup-plugin";
import react from "@vitejs/plugin-react-swc"; import react from "@vitejs/plugin-react-swc";
import { defineConfig } from "vitest/config"; import { defineConfig } from "vitest/config";
@ -9,7 +10,15 @@ export default defineConfig(() => ({
host: "::", host: "::",
port: 8080, port: 8080,
}, },
plugins: [react()], plugins: [
react(),
prerender({
routes: [
"/",
// Add more routes to prerender...
],
}),
],
test: { test: {
globals: true, globals: true,
environment: 'jsdom', environment: 'jsdom',
@ -23,4 +32,4 @@ export default defineConfig(() => ({
"@": path.resolve(__dirname, "./src"), "@": path.resolve(__dirname, "./src"),
}, },
}, },
})); }));