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 Mutative Vs Immer Vs Reducers For Data Handling In React

Comparing React state tools: Mutative vs. Immer vs. reducers

Mutative processes data with better performance than both Immer and native reducers. Let’s compare these data handling options in React.

Rashedul Alam
Apr 26, 2024 â‹… 7 min read
Radix Ui Adoption Guide Overview Examples And Alternatives

Radix UI adoption guide: Overview, examples, and alternatives

Radix UI is quickly rising in popularity and has become an excellent go-to solution for building modern design systems and websites.

Nefe Emadamerho-Atori
Apr 25, 2024 â‹… 11 min read
Understanding The Css Revert Layer Keyword, Part Of Css Cascade Layers

Understanding the CSS revert-layer keyword

In this article, we’ll explore CSS cascade layers — and, specifically, the revert-layer keyword — to help you refine your styling strategy.

Chimezie Innocent
Apr 24, 2024 â‹… 6 min read
Exploring Nushell, A Rust Powered, Cross Platform Shell

Exploring Nushell, a Rust-powered, cross-platform shell

Nushell is a modern, performant, extensible shell built with Rust. Explore its pros, cons, and how to install and get started with it.

Oduah Chigozie
Apr 23, 2024 â‹… 6 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