2
4 Comments

ReactJS ultra slow prod build (25 minutes)

The ReactJS production build takes about 25 minutes to build on my VPS with 2 GB of memory. What is that?!?

Do I need to switch to a better server? What VPS configs are you using for serving react applications on production?

#programming #javascript #reactjs

on September 3, 2022
  1. 2

    If you’re using Webpack try a newer builder like SWC.
    This still sounds long though even for Webpack so it might be a poor quality VPS with slow IO or something. At work we’re using Webpack 5 still and even our largest frontend app only takes ~3 mins to build on a GitHub runner.

  2. 1

    Do you run npm install? I would check how long it takes to download you dependencies first.

  3. 1

    What sort of React app is it?

    How long does it take to compile locally?

    1. 1

      Actually it's simple and for local development & even testing the prod build locally, it works fast, maximum a few minutes for the prod build.

  4. 1

    This comment was deleted 4 years ago