From 8d062e681d79e764098d46f85ffc07aa04f3803a Mon Sep 17 00:00:00 2001 From: Xicri <107226297+xicri@users.noreply.github.com> Date: Sun, 29 Sep 2024 16:53:36 +0900 Subject: [PATCH] chore: migrate to SSG from SSR on Cloudflare Pages/Workers --- nuxt.config.ts | 6 +----- package.json | 6 ++---- tsconfig.json | 5 +---- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/nuxt.config.ts b/nuxt.config.ts index 9db3f94a..90591a26 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -5,12 +5,9 @@ const isLocal = !process.env.SERVER_ENV || process.env.SERVER_ENV === "local"; export default defineNuxtConfig({ compatibilityDate: "2024-07-31", - ssr: true, + ssr: true, // Enable prerender components: true, - nitro: { - preset: "cloudflare-pages", - }, typescript: { strict: true, }, @@ -22,7 +19,6 @@ export default defineNuxtConfig({ }, modules: [ - "nitro-cloudflare-dev", "@nuxtjs/i18n", "@nuxtjs/robots", "@nuxtjs/sitemap", diff --git a/package.json b/package.json index 5daeebab..7d116aee 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,9 @@ "type": "module", "scripts": { "dev": "nuxt dev", - "build": "wrangler types && nuxt build", + "build": "SERVER_ENV=production nuxt generate", "test": "vitest run && playwright test", - "test:server": "wrangler pages dev --local --port=5678", + "test:server": "nuxt dev --port 5678", "vrt": "concurrently --kill-others --success=first \"npm:test:server\" \"npm:vrt:screenshot\" && npm run vrt:reg", "vrt:screenshot": "sleep 5 && esno ./scripts/vrt-screenshot.ts", "vrt:reg": "./scripts/vrt-reg.sh", @@ -27,7 +27,6 @@ "postinstall": "node ./scripts/postinstall.mjs && nuxt prepare && npm list @playwright/test && playwright install || echo 'Playwright installation skipped.'" }, "dependencies": { - "@cloudflare/workers-types": "^4.20240919.0", "@nuxt/devtools": "^1.5.0", "@nuxtjs/i18n": "^8.5.5", "@nuxtjs/robots": "^4.1.7", @@ -40,7 +39,6 @@ "klona": "^2.0.4", "lodash-es": "^4.17.21", "luxon": "^3.5.0", - "nitro-cloudflare-dev": "^0.1.5", "nuxt": "^3.13.2", "pinia": "^2.2.2", "sass": "^1.79.3", diff --git a/tsconfig.json b/tsconfig.json index f12911ee..99107c63 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,9 +16,6 @@ "removeComments": true, "declaration": false, - "lib": [ "esnext", "dom" ], - "types": [ - "@cloudflare/workers-types/2023-07-01" - ] + "lib": [ "esnext", "dom" ] } }