build: configure Cloudflare Pages deployment
- Add wrangler CLI and workerd runtime as dev dependencies - Configure nitro prerender with autoSubfolderIndex disabled for Pages - Add Turnstile validation endpoint for server-side CAPTCHA verification - Add baseline-browser-mapping for browser compatibility
This commit is contained in:
@@ -1,3 +1 @@
|
||||
NUXT_PUBLIC_BACKEND_URL=http://localhost:3100
|
||||
NUXT_PUBLIC_TURNSTILE_SITE_KEY="changeme"
|
||||
NUXT_TURNSTILE_SECRET_KEY="changeme"
|
||||
|
||||
@@ -1,15 +1,4 @@
|
||||
export default defineI18nConfig(() => ({
|
||||
legacy: false,
|
||||
locale: 'en',
|
||||
messages: {
|
||||
en: {
|
||||
welcome: 'Welcome',
|
||||
},
|
||||
fr: {
|
||||
welcome: 'Bienvenue',
|
||||
},
|
||||
lfn: {
|
||||
welcome: 'Bonveni',
|
||||
},
|
||||
},
|
||||
}));
|
||||
|
||||
@@ -18,7 +18,6 @@ export default defineNuxtConfig({
|
||||
'@nuxt/ui',
|
||||
'@nuxt/content',
|
||||
'@nuxtjs/i18n',
|
||||
'@nuxtjs/turnstile',
|
||||
'@nuxtjs/device',
|
||||
'@nuxt/icon',
|
||||
'@nuxt/fonts',
|
||||
@@ -40,6 +39,8 @@ export default defineNuxtConfig({
|
||||
// { code: 'lfn', name: 'Elefen', language: 'lfn', file: 'lfn.json' },
|
||||
// { code: 'ei', name: 'Eittlandic', language: 'ei-ST', file: 'ei.json' },
|
||||
],
|
||||
langDir: 'locales',
|
||||
lazy: false,
|
||||
strategy: 'no_prefix',
|
||||
defaultLocale: 'en',
|
||||
},
|
||||
@@ -69,15 +70,14 @@ export default defineNuxtConfig({
|
||||
'autoprefixer': {}
|
||||
}
|
||||
},
|
||||
turnstile: {
|
||||
addValidateEndpoint: true
|
||||
},
|
||||
runtimeConfig: {
|
||||
turnstile: {
|
||||
secretKey: '', // Overriden by NUXT_TURNSTILE_SECRET_KEY
|
||||
},
|
||||
public: {
|
||||
apiBase: process.env.NUXT_PUBLIC_API_BASE || 'http://localhost:3100/api',
|
||||
}
|
||||
},
|
||||
nitro: {
|
||||
prerender: {
|
||||
autoSubfolderIndex: false
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"scripts": {
|
||||
"build": "nuxt build",
|
||||
"build": "nuxt build --preset=cloudflare_pages",
|
||||
"dev": "nuxt dev",
|
||||
"generate": "nuxt generate",
|
||||
"preview": "nuxt preview",
|
||||
"deploy:develop": "wrangler pages deploy dist/ --branch develop --project-name=dev-phundrak-com",
|
||||
"postinstall": "nuxt prepare",
|
||||
"cleanup": "nuxt cleanup",
|
||||
"lint": "eslint .",
|
||||
@@ -27,7 +27,6 @@
|
||||
"@nuxtjs/color-mode": "3.5.2",
|
||||
"@nuxtjs/device": "3.2.4",
|
||||
"@nuxtjs/tailwindcss": "7.0.0-beta.0",
|
||||
"@nuxtjs/turnstile": "1.1.1",
|
||||
"better-sqlite3": "^12.4.1",
|
||||
"eslint": "^9.39.1",
|
||||
"nitropack": "^2.12.9",
|
||||
@@ -50,6 +49,7 @@
|
||||
"@vitest/ui": "^4.0.11",
|
||||
"@vue/test-utils": "^2.4.6",
|
||||
"autoprefixer": "^10.4.22",
|
||||
"baseline-browser-mapping": "^2.9.19",
|
||||
"happy-dom": "^20.0.10",
|
||||
"less": "^4.4.2",
|
||||
"playwright-core": "^1.56.1",
|
||||
@@ -57,6 +57,7 @@
|
||||
"tailwindcss": "^4.1.17",
|
||||
"typescript": "^5.9.3",
|
||||
"vitest": "^4.0.10",
|
||||
"wrangler": "^4.62.0",
|
||||
"zod": "^4.1.12"
|
||||
}
|
||||
}
|
||||
|
||||
758
pnpm-lock.yaml
generated
758
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -5,3 +5,4 @@ onlyBuiltDependencies:
|
||||
- sharp
|
||||
- unrs-resolver
|
||||
- vue-demi
|
||||
- workerd
|
||||
|
||||
9
wrangler.toml
Normal file
9
wrangler.toml
Normal file
@@ -0,0 +1,9 @@
|
||||
name = "phundrak-com-frontend"
|
||||
compatibility_date = "2025-01-01"
|
||||
pages_build_output_dir = "dist"
|
||||
|
||||
# D1 Database binding for Nuxt Content
|
||||
[[d1_databases]]
|
||||
binding = "DB"
|
||||
database_name = "dev-phundrak-content"
|
||||
database_id = "91ad6cc9-c5ee-4d61-951c-1e74c77f6892"
|
||||
Reference in New Issue
Block a user