January 2019
Intermediate to advanced
460 pages
10h 33m
English
The last step for our React setup is to have a production build. Until now, we were only using webpack-dev-server, but this naturally includes an unimproved development build. Furthermore, webpack automatically spawns a web server. In a later chapter, we introduce Express.js as our web server so we won't need webpack to host it.
A production bundle does merge all JavaScript files, but also CSS files into two separate files. Those can be used directly in the browser. To bundle CSS files, we will rely on another webpack plugin, called MiniCss:
npm install --save-dev mini-css-extract-plugin
We do not want to change the current webpack.client.config.js file, because it is made for development work. Add this command ...
Read now
Unlock full access