From 420c481b84881c7b20487434e627ebbd7195ff9b Mon Sep 17 00:00:00 2001 From: nalpari Date: Thu, 12 Jun 2025 17:36:45 +0900 Subject: [PATCH 1/3] chore: configure webpack for production optimization - Added a webpack configuration to utilize terser-webpack-plugin for minifying JavaScript files in production builds, ensuring no comments are included in the output. --- next.config.ts | 16 ++++++++++++++++ package.json | 1 + 2 files changed, 17 insertions(+) diff --git a/next.config.ts b/next.config.ts index c4728af..58db81e 100644 --- a/next.config.ts +++ b/next.config.ts @@ -19,6 +19,22 @@ const nextConfig: NextConfig = { // }, ] }, + webpack: (config, { dev, isServer }) => { + if (!dev && !isServer) { + config.optimization.minimizer = config.optimization.minimizer || [] + config.optimization.minimizer.push( + new (require('terser-webpack-plugin'))({ + terserOptions: { + format: { + comments: false, + }, + }, + extractComments: false, + }), + ) + } + return config + }, } export default nextConfig diff --git a/package.json b/package.json index 064f055..439c5df 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "@types/react-dom": "^19", "prisma": "^6.7.0", "tailwindcss": "^4", + "terser-webpack-plugin": "^5.3.14", "typescript": "^5" } } From 1af57d09657917b9ee716ef40527824c2171bef1 Mon Sep 17 00:00:00 2001 From: nalpari Date: Thu, 12 Jun 2025 18:09:08 +0900 Subject: [PATCH 2/3] chore: update API URLs for development and production environments - Changed NEXT_PUBLIC_API_URL in .env.development and .env.production to point to the new development and production server URLs, respectively. - Updated baseUrl in config.development.ts and config.production.ts to reflect the new server addresses for consistent environment configuration. --- .env.development | 3 ++- .env.production | 3 ++- src/config/config.development.ts | 3 ++- src/config/config.production.ts | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.env.development b/.env.development index 2ef8329..c3f2519 100644 --- a/.env.development +++ b/.env.development @@ -10,7 +10,8 @@ SESSION_PASSWORD="This application is for mobile field research" # 모바일 디바이스로 로컬 서버 확인하려면 자신 IP 주소로 변경 # 다시 로컬에서 개발할때는 localhost로 변경 #route handler -NEXT_PUBLIC_API_URL=http://172.16.56.60:3000 +# NEXT_PUBLIC_API_URL=http://172.16.56.60:3000 +NEXT_PUBLIC_API_URL=https://dev.hanasysfield.jp #qsp 로그인 api NEXT_PUBLIC_QSP_API_URL=http://121.168.9.37:8080 diff --git a/.env.production b/.env.production index f5f5164..efb8936 100644 --- a/.env.production +++ b/.env.production @@ -8,7 +8,8 @@ DATABASE_POOL_MAX=10 SESSION_PASSWORD="This application is for mobile field research" #route handler -NEXT_PUBLIC_API_URL=http://localhost:3000 +# NEXT_PUBLIC_API_URL=http://localhost:3000 +NEXT_PUBLIC_API_URL=https://hanasysfield.jp #qsp 로그인 api # NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120 diff --git a/src/config/config.development.ts b/src/config/config.development.ts index 665bc9b..a6796e9 100644 --- a/src/config/config.development.ts +++ b/src/config/config.development.ts @@ -1,7 +1,8 @@ import getConfigs from '@/config/config.common' // 환경마다 달라져야 할 변수, 값들을 정의합니다. (여기는 development 환경에 맞는 값을 지정합니다.) -const baseUrl = 'http://172.16.56.60:3000' +// const baseUrl = 'http://172.16.56.60:3000' +const baseUrl = 'https://dev.hanasysfield.jp' const mode = 'development' // 환경마다 달라져야 할 값들을 getConfig 함수에 전달합니다. diff --git a/src/config/config.production.ts b/src/config/config.production.ts index 5b1db52..2965b70 100644 --- a/src/config/config.production.ts +++ b/src/config/config.production.ts @@ -1,7 +1,7 @@ import getConfigs from '@/config/config.common' // 환경마다 달라져야 할 변수, 값들을 정의합니다. (여기는 production 환경에 맞는 값을 지정합니다.) -const baseUrl = 'http://localhost.prod:3000' +const baseUrl = 'https://hanasysfield.jp' const mode = 'production' // 환경마다 달라져야 할 값들을 getConfig 함수에 전달합니다. From 96b5e39a58afc075a83e2f597d3e79f15de0c91d Mon Sep 17 00:00:00 2001 From: nalpari Date: Fri, 13 Jun 2025 12:25:46 +0900 Subject: [PATCH 3/3] chore: update baseUrl for production environment - Commented out the previous production baseUrl and set a new baseUrl to point to the local server IP address for production configuration. - Ensured consistency in environment-specific configurations. --- src/config/config.production.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/config/config.production.ts b/src/config/config.production.ts index 2965b70..bd35fc2 100644 --- a/src/config/config.production.ts +++ b/src/config/config.production.ts @@ -1,7 +1,8 @@ import getConfigs from '@/config/config.common' // 환경마다 달라져야 할 변수, 값들을 정의합니다. (여기는 production 환경에 맞는 값을 지정합니다.) -const baseUrl = 'https://hanasysfield.jp' +// const baseUrl = 'https://hanasysfield.jp' +const baseUrl = 'http://172.16.56.55:3000' const mode = 'production' // 환경마다 달라져야 할 값들을 getConfig 함수에 전달합니다.