diff --git a/.gitignore b/.gitignore index b4c8855..9287f84 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,8 @@ npm-debug.log* !.vscode/extensions.json .DS_Store Thumbs.db + +.dev.vars* +!.dev.vars.example +.env* +!.env.example diff --git a/package-lock.json b/package-lock.json index 30926db..20a8242 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "react-dom": "^19.2.8" }, "devDependencies": { + "@cloudflare/vite-plugin": "^1.47.0", "@eslint/js": "^10.0.1", "@vitejs/plugin-react": "^6.0.4", "eslint": "^10.8.0", @@ -288,6 +289,28 @@ } } }, + "node_modules/@cloudflare/vite-plugin": { + "version": "1.47.0", + "resolved": "https://registry.npmjs.org/@cloudflare/vite-plugin/-/vite-plugin-1.47.0.tgz", + "integrity": "sha512-WyGNYtJ2nzcJXtlwCHTO5S5+flFaYhfH5WfFfx6IpGf2Y/oNwyizEW9mNSImpg65PWmDs1715Pk/vGSKKtYJ1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cloudflare/unenv-preset": "2.16.1", + "miniflare": "4.20260722.0", + "unenv": "2.0.0-rc.24", + "workerd": "1.20260722.1", + "wrangler": "4.114.0", + "ws": "8.21.0" + }, + "bin": { + "cf-vite": "bin/cf-vite" + }, + "peerDependencies": { + "vite": "^6.1.0 || ^7.0.0 || ^8.0.0", + "wrangler": "^4.114.0" + } + }, "node_modules/@cloudflare/workerd-darwin-64": { "version": "1.20260722.1", "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20260722.1.tgz", @@ -1185,9 +1208,6 @@ "arm" ], "dev": true, - "libc": [ - "glibc" - ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1205,9 +1225,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1225,9 +1242,6 @@ "ppc64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1245,9 +1259,6 @@ "riscv64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1265,9 +1276,6 @@ "s390x" ], "dev": true, - "libc": [ - "glibc" - ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1285,9 +1293,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1305,9 +1310,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1325,9 +1327,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "LGPL-3.0-or-later", "optional": true, "os": [ @@ -1345,9 +1344,6 @@ "arm" ], "dev": true, - "libc": [ - "glibc" - ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1371,9 +1367,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1397,9 +1390,6 @@ "ppc64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1423,9 +1413,6 @@ "riscv64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1449,9 +1436,6 @@ "s390x" ], "dev": true, - "libc": [ - "glibc" - ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1475,9 +1459,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1501,9 +1482,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1527,9 +1505,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "Apache-2.0", "optional": true, "os": [ @@ -1843,9 +1818,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1863,9 +1835,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1883,9 +1852,6 @@ "ppc64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1903,9 +1869,6 @@ "s390x" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1923,9 +1886,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1943,9 +1903,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -3025,9 +2982,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -3049,9 +3003,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -3073,9 +3024,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MPL-2.0", "optional": true, "os": [ @@ -3097,9 +3045,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MPL-2.0", "optional": true, "os": [ diff --git a/package.json b/package.json index 59b36d7..d59d262 100644 --- a/package.json +++ b/package.json @@ -7,14 +7,15 @@ "dev": "vite", "build": "vite build", "lint": "eslint .", - "preview": "vite preview", - "deploy": "npm run build && wrangler pages deploy dist --project-name=my-home-page --branch=main" + "preview": "npm run build && wrangler dev", + "deploy": "npm run build && wrangler deploy" }, "dependencies": { "react": "^19.2.8", "react-dom": "^19.2.8" }, "devDependencies": { + "@cloudflare/vite-plugin": "^1.47.0", "@eslint/js": "^10.0.1", "@vitejs/plugin-react": "^6.0.4", "eslint": "^10.8.0", diff --git a/vite.config.js b/vite.config.js index 9ffcc67..b313b5c 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,6 +1,8 @@ import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' +import { cloudflare } from "@cloudflare/vite-plugin"; + export default defineConfig({ - plugins: [react()], -}) + plugins: [react(), cloudflare()], +}) \ No newline at end of file diff --git a/wrangler.jsonc b/wrangler.jsonc new file mode 100644 index 0000000..ddbb4e7 --- /dev/null +++ b/wrangler.jsonc @@ -0,0 +1,14 @@ +{ + "$schema": "node_modules/wrangler/config-schema.json", + "name": "firstpage", + "compatibility_date": "2026-07-26", + "observability": { + "enabled": true + }, + "assets": { + "not_found_handling": "single-page-application" + }, + "compatibility_flags": [ + "nodejs_compat" + ] +}