diff --git a/examples/with-babel-macros/app/layout.tsx b/examples/with-babel-macros/app/layout.tsx new file mode 100644 index 0000000000000..ece5bd2004a41 --- /dev/null +++ b/examples/with-babel-macros/app/layout.tsx @@ -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 ( + + {children} + + ); +} diff --git a/examples/with-babel-macros/pages/index.js b/examples/with-babel-macros/app/page.tsx similarity index 89% rename from examples/with-babel-macros/pages/index.js rename to examples/with-babel-macros/app/page.tsx index 285027178b84e..92e602fa57554 100644 --- a/examples/with-babel-macros/pages/index.js +++ b/examples/with-babel-macros/app/page.tsx @@ -5,7 +5,7 @@ const whoami = preval` module.exports = userInfo.username `; -export default function WhoAmI() { +export default function Home() { return (

diff --git a/examples/with-babel-macros/package.json b/examples/with-babel-macros/package.json index 160fd5c48fdf7..49f920197f274 100644 --- a/examples/with-babel-macros/package.json +++ b/examples/with-babel-macros/package.json @@ -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" } } diff --git a/examples/with-babel-macros/pages/_document.js b/examples/with-babel-macros/pages/_document.js deleted file mode 100644 index 5047e342d89b2..0000000000000 --- a/examples/with-babel-macros/pages/_document.js +++ /dev/null @@ -1,15 +0,0 @@ -import { Html, Head, Main, NextScript } from "next/document"; - -export default function Document({ css }) { - return ( - - -