TypeStrong / ts-loader

TypeScript loader for webpack
https://johnnyreilly.com/ts-loader-goes-webpack-5
MIT License
3.44k stars 429 forks source link

After upgrading from 8.4.0 to 9.4.4, startup of a nodejs/electron app doubled #1634

Closed ericpromislow closed 9 months ago

ericpromislow commented 9 months ago

Expected Behaviour

Startup in development mode of our JS application normally takes about 1 minute on my macBook, from when I enter the command yarn dev, until the UI main window appears.

Actual Behaviour

After bumping ts-loader from 8.4.0 to 9.4.4, that time doubled to about 2 minutes.

Steps to Reproduce the Problem

$ git clone https://github.com/rancher-sandbox/rancher-desktop.git
$ cd rancher-desktop
# See readme for prerecs. Easiest to install and run on Linux or macOS
$ yarn
# In two terminals, simultaneously run the two commands
$ x1=$(date +%s); read y; x2=$(date +%s); expr $x2 - $x1
$ yarn dev

# When the UI comes up, press return in the `x1=...` window and note the time
# Now shutdown Rancher Desktop, and move to commit `853b0cc59 Merge pull request #5287 from rak-phillip/feature/5000-nuxt-removal-functioning (From Thu Sep 21 11:49:22 2023 -0700)

$ git clean -ffdx && yarn
# Again simultaneously run these two commands:
$ x1=$(date +%s); read y; x2=$(date +%s); expr $x2 - $x1
$ yarn dev

And again when the UI comes up, press return in the x1=... window and note the time

Location of a Minimal Repository that Demonstrates the Issue.

https://github.com/rancher-sandbox/rancher-desktop.git

Not minimal, but it takes a lot of work to set up a typescript app.

ericpromislow commented 9 months ago

And when I add the plugins fork-ts-checker-notifier-webpack-plugin and fork-ts-checker-webpack-plugin I'm back to the previous time to start. But I'd rather understand why the time difference going from 8.4 to 9.4

johnnyreilly commented 9 months ago

It's the first time something like this has been reported. Going from 8 to 9 is purely migrating to use webpack 5 explicitly. Can you narrow the issue down to where the specific issue occurs? You're leaping from 8.4 to 9.4. It could be any one of the versions in between causing the issue. Identifying that would help understand.

That said, I'd advise using fork-ts-checker-webpack-plugin and transpileMode: true for preference anyway

ericpromislow commented 9 months ago

Thx, guess we'll just go with using that plugin.