October 2017
Intermediate to advanced
302 pages
7h 27m
English
Our goal for this section is to take the JavaScript sitting in our script tag in our index.html (the line responsible for rendering our "Hello from React!") and move that to a JavaScript file in the src folder, which is then bundled and injected into the HTML by Webpack.
It sounds complicated, but it’s simpler than it sounds, thanks to the magic of Webpack. Let’s get started:
yarn add webpack@3.5.4
If you check the package.json, you should see Webpack listed under our dependencies. For this book, I’ll be using version 3.5.4; if you run into any inexplicable problems, try specifying this version with yarn add webpack@3.5.4:
Read now
Unlock full access