Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ next-env.d.ts
!.dev.vars.example
!.env.example
/.pnpm-store
.lighthouse/
7,249 changes: 7,249 additions & 0 deletions .lighthouse/lighthouse-performance.json

Large diffs are not rendered by default.

16 changes: 7 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
FROM node:20-alpine AS deps
RUN corepack enable && corepack prepare pnpm@9 --activate
FROM oven/bun:1-alpine AS deps
WORKDIR /app

COPY package.json pnpm-lock.yaml ./
COPY package.json bun.lock ./

RUN pnpm install --frozen-lockfile
RUN bun install --frozen-lockfile

FROM node:20-alpine AS builder
RUN corepack enable && corepack prepare pnpm@9 --activate
FROM oven/bun:1-alpine AS builder
WORKDIR /app

COPY --from=deps /app/node_modules ./node_modules
Expand All @@ -16,9 +14,9 @@ COPY . .

ENV NEXT_TELEMETRY_DISABLED=1
ENV DOCKER_BUILD=true
RUN pnpm build
RUN bun run build

FROM node:20-alpine AS runner
FROM oven/bun:1-alpine AS runner
WORKDIR /app

ENV NODE_ENV=production
Expand All @@ -38,4 +36,4 @@ EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME=0.0.0.0

CMD ["node", "server.js"]
CMD ["bun", "server.js"]
8 changes: 8 additions & 0 deletions _components/web-vitals.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"use client";
import { useReportWebVitals } from "next/web-vitals";
import { logWebVitals } from "@/lib/utils";

export const WebVitals = () => {
useReportWebVitals(logWebVitals);
return <div></div>;
};
4 changes: 3 additions & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Header } from "@/components/layout/header";
import { Footer } from "@/components/layout/footer";
import { CartDrawer } from "@/components/cart/cart-drawer";
import { ToastProvider } from "@/components/ui/toast-provider";
import { WebVitals } from "@/_components/web-vitals";

const inter = Inter({ subsets: ["latin"] });

Expand Down Expand Up @@ -35,7 +36,8 @@ export default function RootLayout({
</div>
<CartDrawer />
<ToastProvider />
{process.env.NODE_ENV === "production" ? null : <WebVitals />}
</body>
</html>
);
}
}
2,879 changes: 2,879 additions & 0 deletions bun.lock

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,8 @@ export function debounce<T extends (...args: never[]) => unknown>(
timeout = setTimeout(() => func(...args), wait);
};
}

// eslint-disable-next-line
export const logWebVitals = (metric: any) => {
console.log(metric);
};
Loading