2021-08-15
3558
#babel#react#webpack
Adewale Abati
718
Aug 15, 2021 â‹… 12 min read

The best webpack configurations for React applications

Adewale Abati Web engineer, tech lifestyle YouTuber, public speaker. Building communities and open source for the Next Billion Users.

Recent posts:

Comparing Hattip Vs Express Js For Modern Application Development

Comparing Hattip vs. Express.js for modern app development

Explore what Hattip is, how it works, its benefits and key features, and the differences between Hattip and Express.js.

Antonello Zanini
May 2, 2024 â‹… 8 min read
Using React Shepherd To Build A Site Tour

Using React Shepherd to build a site tour

React Shepherd stands out as a site tour library due to its elegant UI and out-of-the-box, easy-to-use React Context implementation.

Onuorah Bonaventure
May 1, 2024 â‹… 14 min read
A Guide To Cookies In Next Js

A guide to cookies in Next.js

Cookies are crucial to web development. This article will explore how to handle cookies in your Next.js applications.

Georgey V B
Apr 30, 2024 â‹… 10 min read
Handling Dates In JavaScript With Tempo

Handling dates in JavaScript with Tempo

Use the Tempo library to format dates and times in JavaScript while accounting for time zones, daylight saying time, and date internationalization.

Amazing Enyichi Agu
Apr 30, 2024 â‹… 8 min read
View all posts

9 Replies to "The best webpack configurations for React applications"

  1. Great tutorial!! could you plz tell us why the app isn’t working on IE after production build while everything works just fine on dev mode?

  2. How to configure webpack if I want to import a react-native module (not node_module) into reactjs. Both of them being siblings in a mono repo?

  3. It’s great that you’re providing us with beautiful webpack, however, there are a few deprecated plugins in this webpack configuration, such as uglifyjs-webpack-plugin, optimize-css-assets-webpack-plugin, and react lazy loading. However we can use css-minimizer-webpack-plugin ,terser-webpack-plugin instead of optimize-css-assets-webpack-plugin and uglifyjs-webpack-plugin. And React-Loadable is not necessary as it comes with react itself

  4. Great tutorial. I did have a couple of issues, and it probably was because I’ve never setup webpack for myself.
    The first issue was until I had configuration info in webpack.development I kept getting this error “TypeError: require(…) is not a function” when running npm run dev. My second issue was getting the error about not being able to process the app.scss file until I added
    module.exports = () => ({
    module: {
    rules: [
    {
    test: /\.scss$/,
    use: [
    “style-loader”,
    “css-loader”, //
    “sass-loader”, //
    ]
    }
    ]
    }
    });

    to the webpack dev file. Both issues got resolved at the same time since I was playing around with the first on and stumbled on the second one.

Leave a Reply