From ea5fde32d75e6e76441eae7b135d1b0a6b498462 Mon Sep 17 00:00:00 2001 From: Xicri Date: Thu, 11 Jan 2024 13:42:51 +0900 Subject: [PATCH 1/3] fix: only run `@nuxt/devtools` on local machine --- nuxt.config.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nuxt.config.ts b/nuxt.config.ts index f6915922..1da1d9b5 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -1,6 +1,8 @@ import words from "./dataset/words.json"; import tags from "./dataset/tags.json"; +const isLocal = !process.env.SERVER_ENV || process.env.SERVER_ENV === "local"; + export default defineNuxtConfig({ ssr: true, components: true, @@ -78,7 +80,7 @@ export default defineNuxtConfig({ }, devtools: { - enabled: true, + enabled: isLocal, }, // For nuxt-simple-robots and nuxt-simple-sitemap From eaca1d93ec3d6ec0944b2fb16d7f0b70985b0d4b Mon Sep 17 00:00:00 2001 From: Xicri Date: Thu, 11 Jan 2024 13:43:45 +0900 Subject: [PATCH 2/3] chore: move `@nuxt/devtools` to `devDependencies` --- nuxt.config.ts | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nuxt.config.ts b/nuxt.config.ts index 1da1d9b5..eedf9a0b 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -24,7 +24,7 @@ export default defineNuxtConfig({ "@nuxtjs/i18n", "@nuxtjs/sitemap", "@pinia/nuxt", - "@nuxt/devtools", + ...(isLocal ? [ "@nuxt/devtools" ] : []), "nuxt-simple-robots", ], diff --git a/package.json b/package.json index 0f000a7b..1765da67 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,6 @@ "postinstall": "node ./scripts/postinstall.mjs && nuxt prepare && npm list @playwright/test && playwright install || echo 'Playwright installation skipped.'" }, "dependencies": { - "@nuxt/devtools": "^1.0.6", "@nuxtjs/i18n": "^8.0.0", "@nuxtjs/sitemap": "^5.0.1", "@pinia/nuxt": "^0.5.1", @@ -45,6 +44,7 @@ }, "devDependencies": { "@aws-sdk/client-s3": "^3.332.0", + "@nuxt/devtools": "^1.0.6", "@playwright/test": "^1.14.1", "concurrently": "^8.0.1", "eslint": "latest", From eb9f01c1818fbabc976ed8f17829ceb1f4533a17 Mon Sep 17 00:00:00 2001 From: Xicri Date: Thu, 11 Jan 2024 13:06:22 +0900 Subject: [PATCH 3/3] chore: update package-lock.json --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index d2e789d8..63dbc51a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,6 @@ "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "@nuxt/devtools": "^1.0.6", "@nuxtjs/i18n": "^8.0.0", "@nuxtjs/sitemap": "^5.0.1", "@pinia/nuxt": "^0.5.1", @@ -27,6 +26,7 @@ }, "devDependencies": { "@aws-sdk/client-s3": "^3.332.0", + "@nuxt/devtools": "^1.0.6", "@playwright/test": "^1.14.1", "concurrently": "^8.0.1", "eslint": "latest",