Skip to Main Content
React Design Patterns and Best Practices - Second Edition
book

React Design Patterns and Best Practices - Second Edition

by Carlos Santana Roldán
March 2019
Intermediate to advanced content levelIntermediate to advanced
350 pages
7h 28m
English
Packt Publishing
Content preview from React Design Patterns and Best Practices - Second Edition

Setting up a project

In this section, we will look at how to set up a very simple webpack application, using Babel to transpile the JavaScript and the CSS modules to load our locally scoped CSS into the bundle. We will also go through all the features of CSS modules and look at the problems they can solve. The first thing to do is move to an empty folder and run the following code:

  npm init

This will create a package.json with some defaults.

Now, it is time to install the dependencies, with the first one being webpack and the second being webpack-dev-server, which we will use to run the application locally and to create the bundle on the fly:

  npm install webpack webpack-dev-server webpack-cli

Once webpack is installed, it is time to install ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

React 17 Design Patterns and Best Practices - Third Edition

React 17 Design Patterns and Best Practices - Third Edition

Carlos Santana Roldán

Publisher Resources

ISBN: 9781789530179Supplemental Content