Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation very slow #220

Open
arzke opened this issue Nov 19, 2020 · 7 comments
Open

Compilation very slow #220

arzke opened this issue Nov 19, 2020 · 7 comments

Comments

@arzke
Copy link

arzke commented Nov 19, 2020

Hello,

every time I change one of the typescript files, it takes about 20 seconds to compile. I am currently using the following tsconfig.json configuration:

{
  "compilerOptions": {
    "target": "es2019",
    "outDir": ".build",
    "moduleResolution": "node",
    "lib": ["es2019"],
    "rootDir": "./",
    "baseUrl": "./src",
  },
  "include": ["src/**/*.ts"],
  "exclude": ["src/**/*.test.ts"]
}

Any reason why the compilation times are so slow?

@arzke arzke changed the title Compilation times are very slow Compilation very slow Nov 19, 2020
@vectorhacker
Copy link

This seems to be an issue with the latest version of the plugin. I downgraded to 1.1.7 and it went faster.

@smcelhinney
Copy link

The downgrade didn't resolve the issue for me, still very slow. I have also noticed that if I edit more than 1 .ts file and Save All in VSCode, it will attempt to compile them all serially (as in, one after the other). Is this expected behaviour?

@GilSnappy
Copy link

GilSnappy commented Jan 6, 2022

Can confirm that this is still the case now (using serverless-plugin-typescript: 1.1.7, 1.2.0 and 2.1.0).
Any solution?

Using skipLibCheck makes the compilation a bit faster, about 10 seconds

@jega-ms
Copy link

jega-ms commented Feb 16, 2022

i'm facing the same issue with latest release "2.1.1" any updates/workaround ?

@RichardBradley
Copy link

RichardBradley commented Aug 26, 2022

I have the same problem. I have about 800 source files in my project and it takes about 30 sec to recompile when I change a single file.

I have verified that typescript is running in "watch" mode inside serverless-plugin-typescript, so I think this is probably a limitation of typescript itself rather than something that serverless-plugin-typescript is doing wrong.

If anyone has any tips to improve compile time they would be gratefully received.

Some discussion on this here: microsoft/TypeScript#46420

@essaji
Copy link

essaji commented Jun 13, 2023

Its 2023 & this is still an issue

@costa-collibra
Copy link

costa-collibra commented Dec 12, 2023

Can confirm that this is still the case now (using serverless-plugin-typescript: 1.1.7, 1.2.0 and 2.1.0). Any solution?

Using skipLibCheck makes the compilation a bit faster, about 10 seconds

This flag worked wonders for me it’s now under a second thanks for this tip. Was around 20 seconds before

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants