Skip to content

Commit

Permalink
[base] Add vercel toolbar in dev [skip vercel]
Browse files Browse the repository at this point in the history
  • Loading branch information
burtek committed Dec 2, 2024
1 parent 92b3e3f commit 023b5b9
Show file tree
Hide file tree
Showing 5 changed files with 331 additions and 29 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ yarn-error.log*

# env files (can opt-in for committing if needed)
.env*
.env*.local

# vercel
.vercel
Expand Down
4 changes: 3 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import { promises } from 'node:fs';
import { resolve } from 'node:path';

import withVercelToolbar from '@vercel/toolbar/plugins/next';

import { generateRssFeed } from './build-utils/generate-rss.js';


Expand Down Expand Up @@ -39,4 +41,4 @@ if (!process.env.VELITE_STARTED && (isDev || isBuild)) {
const posts = await promises.readFile('./.velite/posts.json', { encoding: 'utf-8' });
await generateRssFeed(JSON.parse(posts), resolve('public/static/rss.xml'));

export default nextConfig;
export default withVercelToolbar()(nextConfig);
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"lint": "next lint"
},
"dependencies": {
"@vercel/toolbar": "^0.1.27",
"classnames": "^2.5.1",
"dayjs": "^1.11.13",
"next": "15.0.3",
Expand All @@ -19,12 +20,12 @@
},
"devDependencies": {
"@dtrw/eslint-config": "^5.3.4",
"@types/node": "^22.9.1",
"@types/node": "^22.10.1",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/rss": "^0.0.32",
"dictionary-pl": "^2.0.0",
"eslint": "^9.15.0",
"eslint": "^9.16.0",
"rehype-slug": "^6.0.0",
"remark-retext": "^6.0.0",
"retext-latin": "^4.0.0",
Expand Down
2 changes: 2 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { VercelToolbar } from '@vercel/toolbar/next';
import type { Metadata } from 'next';
import localFont from 'next/font/local';

Expand Down Expand Up @@ -41,6 +42,7 @@ export default function RootLayout({
{children}
</main>
{footer}
{process.env.NODE_ENV === 'development' && <VercelToolbar />}
</body>
</html>
);
Expand Down
Loading

0 comments on commit 023b5b9

Please sign in to comment.