From 1150279bdc7b2968c38a3aa4d855dd10a507b600 Mon Sep 17 00:00:00 2001 From: Edoardo Date: Thu, 8 Feb 2024 10:37:38 +0100 Subject: [PATCH 1/4] feat: rm deprecated next export --- .env.example | 3 ++- env.d.ts | 1 + next.config.js | 3 +++ package-lock.json | 28 ++++++++++++++++++++++++++++ package.json | 3 ++- 5 files changed, 36 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index a35ddee..ed7906b 100644 --- a/.env.example +++ b/.env.example @@ -1 +1,2 @@ -NEXT_PUBLIC_SITE_URL= \ No newline at end of file +NEXT_PUBLIC_SITE_URL= +USE_STATIC_EXPORT= \ No newline at end of file diff --git a/env.d.ts b/env.d.ts index f279762..20aa13d 100644 --- a/env.d.ts +++ b/env.d.ts @@ -2,6 +2,7 @@ declare global { namespace NodeJS { interface ProcessEnv { NEXT_PUBLIC_SITE_URL: string; + USE_STATIC_EXPORT: string; } } } diff --git a/next.config.js b/next.config.js index 9fbb35c..e4c59d4 100644 --- a/next.config.js +++ b/next.config.js @@ -19,6 +19,9 @@ const nextConfig = { ignoreDuringBuilds: true, }, + // https://nextjs.org/docs/pages/building-your-application/deploying/static-exports + output: process.env.USE_STATIC_EXPORT === "true" ? "export" : undefined, + webpack: (config) => { // https://react-svgr.com/ config.module.rules.push({ diff --git a/package-lock.json b/package-lock.json index 13534c0..87a70cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,6 +26,7 @@ "@types/node": "20.10.7", "@types/react": "18.2.47", "autoprefixer": "10.4.16", + "cross-env": "7.0.3", "eslint": "8.56.0", "eslint-plugin-tailwindcss": "3.13.1", "husky": "8.0.3", @@ -4300,6 +4301,24 @@ "node": ">=10" } }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -12375,6 +12394,15 @@ "yaml": "^1.10.0" } }, + "cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.1" + } + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", diff --git a/package.json b/package.json index 919e1ec..04c5893 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "dev": "next dev", "build": "next build", "start": "next start", - "export": "npm run build && next export", + "export": "cross-env USE_STATIC_EXPORT=true npm run build", "analyze": "ANALYZE=true npm run build", "typecheck": "tsc --noEmit", "lint": "eslint --color --cache --cache-location 'node_modules/.cache/eslint/.eslint-cache' 'pages/**/*.{js,jsx,ts,tsx}' 'features/**/*.{js,jsx,ts,tsx}'", @@ -99,6 +99,7 @@ "@types/node": "20.10.7", "@types/react": "18.2.47", "autoprefixer": "10.4.16", + "cross-env": "7.0.3", "eslint": "8.56.0", "eslint-plugin-tailwindcss": "3.13.1", "husky": "8.0.3", From 0a5421fcaa37a255f4e0ed4bcc73d6f886fd7094 Mon Sep 17 00:00:00 2001 From: Edoardo Date: Tue, 2 Apr 2024 13:18:27 +0200 Subject: [PATCH 2/4] feat: revert extra changes --- .env.example | 3 +-- env.d.ts | 1 - next.config.js | 3 --- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.env.example b/.env.example index ed7906b..a35ddee 100644 --- a/.env.example +++ b/.env.example @@ -1,2 +1 @@ -NEXT_PUBLIC_SITE_URL= -USE_STATIC_EXPORT= \ No newline at end of file +NEXT_PUBLIC_SITE_URL= \ No newline at end of file diff --git a/env.d.ts b/env.d.ts index 20aa13d..f279762 100644 --- a/env.d.ts +++ b/env.d.ts @@ -2,7 +2,6 @@ declare global { namespace NodeJS { interface ProcessEnv { NEXT_PUBLIC_SITE_URL: string; - USE_STATIC_EXPORT: string; } } } diff --git a/next.config.js b/next.config.js index e4c59d4..9fbb35c 100644 --- a/next.config.js +++ b/next.config.js @@ -19,9 +19,6 @@ const nextConfig = { ignoreDuringBuilds: true, }, - // https://nextjs.org/docs/pages/building-your-application/deploying/static-exports - output: process.env.USE_STATIC_EXPORT === "true" ? "export" : undefined, - webpack: (config) => { // https://react-svgr.com/ config.module.rules.push({ From e88dce4fcfe87ac2f02b68002dd313fb213eb8f3 Mon Sep 17 00:00:00 2001 From: Edoardo Date: Tue, 2 Apr 2024 13:19:20 +0200 Subject: [PATCH 3/4] feat: rm deprecated next export command --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 04c5893..6e92491 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,6 @@ "dev": "next dev", "build": "next build", "start": "next start", - "export": "cross-env USE_STATIC_EXPORT=true npm run build", "analyze": "ANALYZE=true npm run build", "typecheck": "tsc --noEmit", "lint": "eslint --color --cache --cache-location 'node_modules/.cache/eslint/.eslint-cache' 'pages/**/*.{js,jsx,ts,tsx}' 'features/**/*.{js,jsx,ts,tsx}'", From dbac395b743950107744492459a0ac27186c2d44 Mon Sep 17 00:00:00 2001 From: Edoardo Date: Tue, 2 Apr 2024 13:19:55 +0200 Subject: [PATCH 4/4] feat: rm cross-env dep --- package-lock.json | 28 ---------------------------- package.json | 1 - 2 files changed, 29 deletions(-) diff --git a/package-lock.json b/package-lock.json index 87a70cc..13534c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,6 @@ "@types/node": "20.10.7", "@types/react": "18.2.47", "autoprefixer": "10.4.16", - "cross-env": "7.0.3", "eslint": "8.56.0", "eslint-plugin-tailwindcss": "3.13.1", "husky": "8.0.3", @@ -4301,24 +4300,6 @@ "node": ">=10" } }, - "node_modules/cross-env": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", - "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.1" - }, - "bin": { - "cross-env": "src/bin/cross-env.js", - "cross-env-shell": "src/bin/cross-env-shell.js" - }, - "engines": { - "node": ">=10.14", - "npm": ">=6", - "yarn": ">=1" - } - }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -12394,15 +12375,6 @@ "yaml": "^1.10.0" } }, - "cross-env": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", - "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.1" - } - }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", diff --git a/package.json b/package.json index 6e92491..d96de47 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,6 @@ "@types/node": "20.10.7", "@types/react": "18.2.47", "autoprefixer": "10.4.16", - "cross-env": "7.0.3", "eslint": "8.56.0", "eslint-plugin-tailwindcss": "3.13.1", "husky": "8.0.3",