Unverified Commit 24615395 authored by PapatMayuri's avatar PapatMayuri Committed by GitHub

Update with next sass example (#73548)

This PR updates the `with-next-sass` example for using the App Router.
Here are the changes that have been made:

- I renamed the `pages` folder and moved it to the `app` folder.
- Added the `layout.tsx` file as part of the App Router.
- Updated the package.json file.

CC: @samcx

---------
Co-authored-by: 's avatarSam Ko <sam@vercel.com>
parent a28160a8
import "../styles.scss";
function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />;
}
export default MyApp;
...@@ -3,8 +3,12 @@ ...@@ -3,8 +3,12 @@
# dependencies # dependencies
/node_modules /node_modules
/.pnp /.pnp
.pnp.js .pnp.*
.yarn/install-state.gz .yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions
# testing # testing
/coverage /coverage
...@@ -24,6 +28,7 @@ ...@@ -24,6 +28,7 @@
npm-debug.log* npm-debug.log*
yarn-debug.log* yarn-debug.log*
yarn-error.log* yarn-error.log*
.pnpm-debug.log*
# local env files # local env files
.env*.local .env*.local
......
...@@ -13,15 +13,15 @@ Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_mediu ...@@ -13,15 +13,15 @@ Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_mediu
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init), [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/), or [pnpm](https://pnpm.io) to bootstrap the example: Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init), [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/), or [pnpm](https://pnpm.io) to bootstrap the example:
```bash ```bash
npx create-next-app --example with-next-sass with-next-sass-app npx create-next-app --example with-sass with-sass-app
``` ```
```bash ```bash
yarn create next-app --example with-next-sass with-next-sass-app yarn create next-app --example with-sass with-sass-app
``` ```
```bash ```bash
pnpm create next-app --example with-next-sass with-next-sass-app pnpm create next-app --example with-sass with-sass-app
``` ```
Run production build with: Run production build with:
......
import type { Metadata } from "next";
import "@/styles/globals.scss";
export const metadata: Metadata = {
title: "With Sass",
description: "Next.js example with Sass.",
};
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
}
import HelloWorld from "../components/hello-world"; import HelloWorld from "@/components/hello-world";
export default function Home() { export default function Home() {
return ( return (
......
{ {
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next", "dev": "next dev",
"build": "next build", "build": "next build",
"start": "next start" "start": "next start"
}, },
"dependencies": { "dependencies": {
"next": "latest", "next": "latest",
"react": "^18.2.0", "react": "^19.0.0",
"react-dom": "^18.2.0", "react-dom": "^19.0.0",
"sass": "1.26.3" "sass": "^1.82.0"
},
"devDependencies": {
"@types/node": "^22.10.1",
"@types/react": "^19.0.1",
"typescript": "^5.7.2"
} }
} }
{
"compilerOptions": {
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment