[ Learning ] Next.js
- Install next, react and react-dom in your project:
npm install next react react-dom
- Open ' package.json ' and add the following ' scripts ':
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start"
-
Create a ' pages ' directory inside your project
-
Populate ' ./pages/index.js ' with the following contents:
export default () =>
<div> Hello Next.js! </div>
- To start the server:
npm run dev