Skip to content

Commit

Permalink
vercel analytics 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
hyunmindev committed Mar 12, 2023
1 parent a9b6c7d commit cc57a85
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 8 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,20 @@
- Typescript
- Bundle Analyzer

- styled-components

- next-sitemap
- next-seo

- Eslint
- Prettier
- Stylelint

- Husky
- Lint staged

- Vercel

## Customization

1. customize name in `package.json`
Expand Down
15 changes: 15 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"prepare": "husky install"
},
"dependencies": {
"@vercel/analytics": "^0.1.11",
"next": "13.2.3",
"next-seo": "^5.15.0",
"next-sitemap": "^4.0.2",
Expand Down
9 changes: 9 additions & 0 deletions src/app/components/AnalyticsWrapper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use client';

import { Analytics } from '@vercel/analytics/react';

function AnalyticsWrapper() {
return <Analytics />;
}

export default AnalyticsWrapper;
23 changes: 16 additions & 7 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
import { ReactNode } from 'react';

import AnalyticsWrapper from './components/AnalyticsWrapper';

interface Props {
children: ReactNode;
}

export const metadata = {
description: 'Generated by create next app',
title: 'Create Next App',
};

export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
function RootLayout({ children }: Props) {
return (
<html lang="en">
<body>{children}</body>
<html lang="ko">
<body>
{children}
<AnalyticsWrapper />
</body>
</html>
);
}

export default RootLayout;
4 changes: 3 additions & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
export default function Home() {
function Index() {
return (
<main>
<h1>Next.js + TypeScript + Tailwind CSS</h1>
</main>
);
}

export default Index;

0 comments on commit cc57a85

Please sign in to comment.