Configure webpack
Now that you’ve installed webpack, let’s create the webpack configuration file so we can bundle our project. Depending on your application, it might make sense to split its code across multiple files or aggregate everything into a single file. webpack assembles the source files in a different set of files for deployment. This way you can always choose the most efficient deployment strategy, without changing your source code layout. In an application with multiple screens, you could place all dependencies that are used in every screen in one file, and the code for each screen in a separate file. That way the user only downloads the code for the page they visit. For simple applications like our word counter, which only has a single ...
Get React for Real now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.