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:

Implementing Infinite Scroll In Next Js With Server Actions

Implementing infinite scroll in Next.js with Server Actions

Infinite scrolling in Next.js no longer requires external libraries — Server Actions let us fetch initial data directly on the server.

Rahul Chhodde
Apr 19, 2024 â‹… 10 min read
Integrating Django Templates With React For Dynamic Webpages

Integrating Django templates with React for dynamic webpages

Create a dynamic demo blog site using Django and React to demonstrate Django’s server-side functionalities and React’s interactive UI.

Kayode Adeniyi
Apr 18, 2024 â‹… 7 min read
Using Aoi Js To Build A Bot For Discord

Using aoi.js to build a bot on Discord

Explore how the aoi.js library makes it easy to create Discord bots with useful functionalities for frontend applications.

Rahul Padalkar
Apr 17, 2024 â‹… 9 min read
Web Components Adoption Guide: Overview, Examples, And Alternatives

Web Components adoption guide: Overview, examples, and alternatives

Evaluate Web Components, a set of standards that allow you to create custom HTML tags for more reusable, manageable code.

Elijah Asaolu
Apr 16, 2024 â‹… 11 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