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:

Nx Adoption Guide: Overview, Examples, And Alternatives

Nx adoption guide: Overview, examples, and alternatives

Let’s explore Nx features, use cases, alternatives, and more to help you assess whether it’s the right tool for your needs.

Andrew Evans
Mar 28, 2024 â‹… 9 min read
Understanding Security In React Native Applications

Understanding security in React Native applications

Explore the various security threats facing React Native mobile applications and how to mitigate them.

Wisdom Ekpotu
Mar 27, 2024 â‹… 10 min read
Warp Adoption Guide: Overview, Examples, And Alternatives

warp adoption guide: Overview, examples, and alternatives

The warp web framework for Rust offers many enticing features. Let’s see when and why you should consider using warp in your projects.

Ukeje Goodness
Mar 26, 2024 â‹… 8 min read
Integrating Next Js And Signalr For Enhanced Real Time Web App Capabilities

Integrating Next.js and SignalR to build real-time web apps

In this tutorial, you’ll learn how to integrate Next.js and SignalR to build an enhanced real-time web application.

Clara Ekekenta
Mar 25, 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