Skip to content

Commit b4ca4eb

Browse files
committed
feat: init metadata
1 parent 482d9ec commit b4ca4eb

19 files changed

+105
-158
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,6 @@ yarn-error.log*
3434
# typescript
3535
*.tsbuildinfo
3636
next-env.d.ts
37+
38+
# analyze
39+
/analyze

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ dist/
22
node_modules/
33
.next/
44
pnpm-lock.yaml
5-
package-lock.json
5+
package-lock.json
6+
/analyze

config/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { seo } from './seo';

config/seo.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export const seo = {
2+
title: 'zhw | fe',
3+
description: '我叫zhw。',
4+
url: new URL(
5+
process.env.NODE_ENV === 'production' ? 'http://localhost:3000' : 'http://localhost:3000',
6+
),
7+
} as const;

eslint.config.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const reactHooks = require('eslint-plugin-react-hooks');
77
const { resolve } = require('path');
88
module.exports = [
99
{
10-
ignores: ['node_modules/**', '.next/**', './eslint.config.cjs', '.gitignore'],
10+
ignores: ['node_modules/**', '.next/**', './eslint.config.cjs', '.gitignore','analyze/**'],
1111
},
1212
{
1313
files: ['**/*.{js,jsx,ts,tsx}'],

next.config.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ import NextBundleAnalyzer from '@next/bundle-analyzer'
33

44
let nextConfig = {};
55

6-
nextConfig = NextBundleAnalyzer({
6+
if(process.env.ANALYZE === 'true'){
7+
nextConfig = NextBundleAnalyzer({
78
enabled: true,
89
})(nextConfig)
10+
}
11+
912

1013
export default nextConfig;

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
6-
"analyze": "set ANALYZE=true && set BUNDLE_ANALYZE=browser && npm run build",
7-
"dev": "next dev",
6+
"dev": "set ANALYZE=false && next dev",
87
"build": "next build",
98
"start": "next start",
109
"lint": "eslint \"src/**/*.{js,ts,jsx,tsx}\" --fix",
1110
"lint:ci": "eslint \"src/**/*.{js,ts,jsx,tsx}\"",
1211
"format": "prettier --write .",
1312
"format:ci": "prettier --list-different \"**/*.{ts,tsx,js,jsx}\"",
14-
"prepare": "husky"
13+
"prepare": "husky",
14+
"analyze": "set ANALYZE=true && set BUNDLE_ANALYZE=browser && npm run build"
1515
},
1616
"dependencies": {
1717
"@next/bundle-analyzer": "^14.2.15",
@@ -57,7 +57,7 @@
5757
"nextBundleAnalysis": {
5858
"budget": 358400,
5959
"budgetPercentIncreaseRed": 20,
60-
"minimumChangeThreshold": 0,
60+
"minimumChangeThreshold":102400,
6161
"showDetails": true
6262
}
6363
}

public/favicon.ico

1.12 KB
Binary file not shown.

src/app/(app)/(home)/page.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function Home() {
2+
return <div>哈哈哈</div>;
3+
}

src/app/(app)/layout.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import type { PropsWithChildren } from 'react';
2+
3+
export default async function RootLayout({ children }: PropsWithChildren) {
4+
return <div>{children}</div>;
5+
}

0 commit comments

Comments
 (0)