Description
Is this a bug report?
Yes,
The production build of a TypeScript project requires almost an hour to complete.
I have tried many different version combinations all with the same result; either my system crashes or I get a very slow build process.
yarn start takes about 5 min and my production build takes almost 1 hour; it's quite consistent.
Currently on the following versions.
"@types/styled-components": "4.1.10",
"react-scripts": "3.0.0",
"typescript": "3.3.4000",
Did you try recovering your dependencies?
I have deleted these files numerous times and tried a few of the typescript-dev versions as well as the styled-component types.
I am using Yarn
Version 1.15.2
Which terms did you search for in User Guide?
script react-scripts tsc build slow
typescript cra creating optimized production build takes an hour
Environment
Issues are consistent in both environments.
- Windows 16GB RAM, WSL (Ubuntu Install)
- IBM Cloud Docker Instance
npx: installed 91 in 18.872s
Environment Info:
System:
OS: Linux 4.4 Ubuntu 18.04.1 LTS (Bionic Beaver)
CPU: (4) x64 Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
Binaries:
Node: 11.11.0 - ~/.nvm/versions/node/v11.11.0/bin/node
Yarn: 1.15.2 - /usr/bin/yarn
npm: 6.7.0 - ~/.nvm/versions/node/v11.11.0/bin/npm
Browsers:
Chrome: Not Found
Firefox: Not Found
npmPackages:
react: Not Found
react-dom: Not Found
react-scripts: Not Found
npmGlobalPackages:
create-react-app: Not Found
Steps to Reproduce
This is a very large project with hundreds of components.
"start": react-scripts start", (5-6 min)
"build": "tsc && react-scripts build" (~53min),
I upgraded my existing installation to the newest version of React which supports Hooks and integrated TypeScript which caused the development server to slow down on first launch; with the console displaying the following.
Files successfully emitted, waiting for typecheck results...
When I commit and merge the code, a deployment build is spun up in a Docker instance which takes almost an hour to complete.
Expected Behavior
I would expect the production build to take no more than 10 min.
The development server should also launch a bit quicker.