Skip to content

Commit

Permalink
[fix] NODE_ENV 빌드 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
euije committed Mar 13, 2024
1 parent 3bddb73 commit 9f27195
Show file tree
Hide file tree
Showing 8 changed files with 4,555 additions and 6,737 deletions.
40 changes: 3 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,4 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
# Ref

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
- https://github.com/vercel/next.js/issues/42651
- https://github.com/vercel/next.js/issues/57277
6 changes: 3 additions & 3 deletions app/event/university/Booth/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export default function Page() {
useEffect(() => {
if (typeof window !== 'undefined') {
if (isIOS) {
window.location.href = APP_STORE_URL;
window.location.replace(APP_STORE_URL);
} else if (isAndroid) {
window.location.href = GOOGLE_PLAY_URL;
window.location.replace(GOOGLE_PLAY_URL);
} else {
window.location.href = LANDING_PAGE_URL;
window.location.replace(LANDING_PAGE_URL);
}
}
}, []);
Expand Down
3 changes: 2 additions & 1 deletion app/not-found.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Button } from '@/component/Button';
import yello_question_svg from '@/component/Icon/asset/yello-question.svg';
import { pallete } from '@/styles/Color';
import Link from 'next/link';
import type { Route } from 'next';

export default function NotFound() {
return (
Expand All @@ -29,7 +30,7 @@ export default function NotFound() {
</BodyMedium>
<Spacing size={64} />

<Link href={'/school-attack'}>
<Link href={'/school-attack' as Route}>
<Button
className='text-black'
size='L'
Expand Down
12 changes: 7 additions & 5 deletions app/school-attack/[[...groupId]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ export default function Page() {
)}
<Spacing size={12} />
<LabelMedium className='text-center text-grayscales-600'>
{statisticsQuery.isFetching
{statisticsQuery.isLoading
? ''
: `${new Intl.DateTimeFormat('ko-KR', {
year: 'numeric',
Expand Down Expand Up @@ -544,7 +544,7 @@ export default function Page() {
/>
</section>
<section className='px-5 flex flex-col items-center my-3'>
{commentQuery.isFetching ? (
{commentQuery.isLoading ? (
<Spinner />
) : (
<>
Expand Down Expand Up @@ -583,19 +583,21 @@ export default function Page() {
)}
</section>
<div className='w-full mb-28'>
{commentQuery.isFetching ? (
{commentQuery.isLoading ? (
<Spinner />
) : (
<Pagination
marginPageCount={0}
pageCount={commentQuery.data?.data.pageCount as number}
// eslint-disable-next-line
pageCount={commentQuery.data?.data.pageCount! as number}
currentPage={commentPage + 1}
onPageChange={(e, n) => {
const next = n - 1;

if (
next < 0 ||
next > (commentQuery.data?.data.totalCount as number)
// eslint-disable-next-line
next > (commentQuery.data?.data.totalCount! as number)
)
return;
setCommentPage(next);
Expand Down
5 changes: 4 additions & 1 deletion component/Layout/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ export const TopBar = () => {

// https://nextjs.org/docs/messages/react-hydration-error#solution-1-using-useeffect-to-run-on-the-client-only
useEffect(() => {
if (localStorage.getItem('accessToken') !== undefined) {
if (
typeof localStorage !== 'undefined' &&
localStorage.getItem('accessToken') !== undefined
) {
setIsLogin(true);
}
}, []);
Expand Down
3 changes: 3 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ const nextConfig = {
buildActivity: true,
buildActivityPosition: 'bottom-right',
},
experimental: {
typedRoutes: true,
},
};

module.exports = nextConfig;
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"homepage": "http://yelloworld.shop",
"scripts": {
"dev": "next dev --turbo",
"build": "next build",
"build": "NODE_ENV=production next build",
"start": "next start",
"lint": "next lint",
"format": "yarn prettier . --write",
Expand Down Expand Up @@ -55,5 +55,6 @@
"prettier": "3.0.2",
"typescript": "latest",
"typescript-plugin-css-modules": "^5.0.2"
}
},
"packageManager": "yarn@1.22.19"
}
Loading

0 comments on commit 9f27195

Please sign in to comment.