Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated with-babel-macros example to utilize the app router. #73347

Merged
merged 6 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
18 changes: 18 additions & 0 deletions examples/with-babel-macros/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { Metadata } from "next";

export const metadata: Metadata = {
title: "Next.js",
description: "Generated by Next.js",
};

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const whoami = preval`
module.exports = userInfo.username
`;

export default function WhoAmI() {
export default function Home() {
return (
<div style={{ display: "flex", justifyContent: "center" }}>
<h1>
Expand Down
13 changes: 8 additions & 5 deletions examples/with-babel-macros/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{
"private": true,
"scripts": {
"dev": "next",
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"dependencies": {
"next": "latest",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"preval.macro": "^5.0.0",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"babel-plugin-macros": "^2.4.2",
"preval.macro": "^3.0.0"
"babel-plugin-macros": "^3.1.0",
"@types/node": "^22.10.1",
"@types/react": "^18.3.12",
"typescript": "^5.7.2"
}
}
15 changes: 0 additions & 15 deletions examples/with-babel-macros/pages/_document.js

This file was deleted.

Loading
Loading