title: Creating an optimized build freezes and never completes
body: <p>I am trying to build my react app. But when I run &quot;npm run build&quot;, The terminal freezes on &quot;Creating and optimized production build...&quot; and never finish.
  This is my JSON file. I tried on 16 GB ram also.</p>
  <p>I have deleted package lock file and also rebuild the dependencies. But it remains same.
  There is no specific solution anywhere, if anyone has solution please let me know.</p>
  <pre><code>{
    &quot;name&quot;: &quot;demoapp&quot;,
    &quot;version&quot;: &quot;0.1.0&quot;,
    &quot;private&quot;: true,
    &quot;dependencies&quot;: {
      &quot;@emotion/react&quot;: &quot;^11.4.1&quot;,
      &quot;@emotion/styled&quot;: &quot;^11.3.0&quot;,
      &quot;@material-ui/core&quot;: &quot;^4.12.2&quot;,
      &quot;@material-ui/data-grid&quot;: &quot;^4.0.0-alpha.33&quot;,
      &quot;@material-ui/lab&quot;: &quot;^4.0.0-alpha.60&quot;,
      &quot;@mui/material&quot;: &quot;^5.0.3&quot;,
      &quot;@progress/kendo-drawing&quot;: &quot;^1.16.0&quot;,
      &quot;@progress/kendo-licensing&quot;: &quot;^1.2.1&quot;,
      &quot;@progress/kendo-react-pdf&quot;: &quot;^4.12.0&quot;,
      &quot;@progress/kendo-theme-material&quot;: &quot;^4.43.0&quot;,
      &quot;@progress/kendo-ui&quot;: &quot;^2021.3.1109&quot;,
      &quot;@testing-library/jest-dom&quot;: &quot;^5.11.4&quot;,
      &quot;@testing-library/react&quot;: &quot;^11.1.0&quot;,
      &quot;@testing-library/user-event&quot;: &quot;^12.1.10&quot;,
      &quot;axios&quot;: &quot;^0.21.1&quot;,
      &quot;bootstrap&quot;: &quot;^5.0.2&quot;,
      &quot;chart.js&quot;: &quot;^3.5.0&quot;,
      &quot;dom-to-pdf&quot;: &quot;^0.2.2&quot;,
      &quot;draft-js&quot;: &quot;^0.11.7&quot;,
      &quot;draftjs-to-html&quot;: &quot;^0.9.1&quot;,
      &quot;html-to-draftjs&quot;: &quot;^1.5.0&quot;,
      &quot;pdf-viewer-reactjs&quot;: &quot;^2.2.3&quot;,
      &quot;react&quot;: &quot;^17.0.2&quot;,
      &quot;react-app-polyfill&quot;: &quot;^2.0.0&quot;,
      &quot;react-chartjs-2&quot;: &quot;^3.0.4&quot;,
      &quot;react-csv&quot;: &quot;^2.0.3&quot;,
      &quot;react-dom&quot;: &quot;^17.0.2&quot;,
      &quot;react-draft-wysiwyg&quot;: &quot;^1.14.7&quot;,
      &quot;react-hook-form&quot;: &quot;^7.10.1&quot;,
      &quot;react-icons&quot;: &quot;^4.2.0&quot;,
      &quot;react-loader&quot;: &quot;^2.4.7&quot;,
      &quot;react-loader-spinner&quot;: &quot;^4.0.0&quot;,
      &quot;react-modal-video&quot;: &quot;^1.2.8&quot;,
      &quot;react-redux&quot;: &quot;^7.2.4&quot;,
      &quot;react-responsive-carousel&quot;: &quot;^3.2.21&quot;,
      &quot;react-router-dom&quot;: &quot;^5.2.0&quot;,
      &quot;react-scripts&quot;: &quot;^4.0.3&quot;,
      &quot;react-table&quot;: &quot;^7.7.0&quot;,
      &quot;reactstrap&quot;: &quot;^8.9.0&quot;,
      &quot;redux&quot;: &quot;^4.1.0&quot;,
      &quot;redux-thunk&quot;: &quot;^2.3.0&quot;,
      &quot;sweetalert2&quot;: &quot;^11.0.18&quot;,
      &quot;web-vitals&quot;: &quot;^1.0.1&quot;
    },
    &quot;scripts&quot;: {
      &quot;start&quot;: &quot;react-scripts start&quot;,
      &quot;build&quot;: &quot;react-scripts build&quot;,
      &quot;test&quot;: &quot;react-scripts test&quot;,
      &quot;eject&quot;: &quot;react-scripts eject&quot;
    },
    &quot;eslintConfig&quot;: {
      &quot;extends&quot;: [
        &quot;react-app&quot;,
        &quot;react-app/jest&quot;
      ]
    },
    &quot;browserslist&quot;: {
      &quot;production&quot;: [
        &quot;&gt;0.2%&quot;,
        &quot;not dead&quot;,
        &quot;not op_mini all&quot;
      ],
      &quot;development&quot;: [
        &quot;ie 11&quot;,
        &quot;last 1 chrome version&quot;,
        &quot;last 1 firefox version&quot;,
        &quot;last 1 safari version&quot;
      ]
    }
  }
  </code></pre>