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:

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
Using Aws Lambda And Aws Cloudfront To Optimize Image Handling

Using AWS Lambda and CloudFront to optimize image handling

Leverage services like AWS Lambda, CloudFront, and S3 to handle images more effectively, optimizing performance and providing a better UX.

Nitish Sharma
Apr 12, 2024 â‹… 12 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