Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Next.js Quick Start Guide

You're reading from   Next.js Quick Start Guide Server-side rendering done right

Arrow left icon
Product type Paperback
Published in Jul 2018
Publisher Packt
ISBN-13 9781788993661
Length 164 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Kirill Konshin Kirill Konshin
Author Profile Icon Kirill Konshin
Kirill Konshin
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface 1. Introduction to Server-Side Rendering and Next.js 2. Next.js fundamentals FREE CHAPTER 3. Next.js Configuration 4. Next.js Data Flow 5. Application Life Cycle Handlers and Business Logic 6. Continuous Integration 7. Containers 8. Other Books You May Enjoy

Installation of Next.js

First, create an empty project folder and initialize npm in it:

$ mkdir next-js-condensed
$ cd next-js-condensed
$ npm init

After that, let's install the Next.js package:

$ npm install nextjs@latest --save-dev
$ npm install react@latest react-dom@latest --save

We save Next.js to devDependencies to clearly separate dependencies for the client and for the server. Server-side dependencies will be in the devDependencies section; the client's will be in the regular section.

If you're using Git or any similar source control tool, it makes sense to add an ignore file that will remove the build artifacts folder from source control. We show an example .gitignore file here:

.DS_Store
.idea
.next
.vscode
build
coverage
node_modules
npm-debug*
out
yarn-debug*
yarn-error*
You have been reading a chapter from
Next.js Quick Start Guide
Published in: Jul 2018
Publisher: Packt
ISBN-13: 9781788993661
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime