Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/next-migration #3

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

env.tsx
env.tsx

.next/
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
# 2024-1-VSA-9dokme-T04-Client
# 2024-1-VSA-9dokme-T04-Client

## Next.js 마이그레이션

### 1. 프로젝트 루트 디렉토리에서 아래 커맨드를 실행합니다.

node v18.X.X 이상을 사용해야 합니다.(node -v)

npm install next react react-dom
npx next dev

그래도 안되면
rm -rf node_modules package-lock.json
npm install

### 2. 로컬에서 실행시, 이래 커맨드 실행 시 나오는 url로 접속합니다.

npm run dev

### 참조 문서

https://nextjs.org/docs/app/building-your-application
https://book.hajoeun.dev/friendly-next-js
6 changes: 6 additions & 0 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference types="next/navigation-types/compat/navigation" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
43 changes: 43 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/** @type {import('next').NextConfig} */

const nextConfig = {
assetPrefix:
process.env.NODE_ENV === "production"
? process.env.NEXT_PUBLIC_SERVICE_URL
: undefined,
compress: true,
env: {
NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL,
NEXT_PUBLIC_NODE_ENV: process.env.NEXT_PUBLIC_NODE_ENV,
NEXT_PUBLIC_SERVICE_URL: process.env.NEXT_PUBLIC_SERVICE_URL,
NEXT_PUBLIC_GOOGLE_ANALYTICS: process.env.NEXT_PUBLIC_GOOGLE_ANALYTICS,
},
output: "standalone",
reactStrictMode: true,
pageExtensions: ["ts", "tsx"],
images: {
formats: ["image/avif", "image/webp"],
dangerouslyAllowSVG: true,
domains: ["9dokme.net"],
remotePatterns: [
{
protocol: "https",
hostname: "9dokme.net",
},
],
},
async redirects() {
return [
{
source: "/mainPage",
destination: "/main",
permanent: true,
},
];
},
compiler: {
styledComponents: true,
},
};

export default nextConfig;
Loading