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

How to debug/fix slow build times in Lerna monorepo? #808

Closed
coreybruyere opened this issue Aug 19, 2020 · 2 comments
Closed

How to debug/fix slow build times in Lerna monorepo? #808

coreybruyere opened this issue Aug 19, 2020 · 2 comments
Labels
kind: optimization Performance, space, size, etc improvement kind: support Asking for support with something or a specific use case scope: upstream Issue in upstream dependency topic: monorepo Related to Lerna monorepos

Comments

@coreybruyere
Copy link

Current Behavior

I have a lerna mono repo with 2 packages. The first package is a small UI component library with about 20 small components, and the other package builds and generates typed SVG icons so they can be imported as React components.

When running tsdx build on both of these packages, the cli process seems to hang up. Sometimes it finishes, sometimes it doesn't. When it finishes the total build time per package is around 4-7 minutes.

It hangs up when building modules and this is all I see on my cli:

✓ Creating entry file 24.2 secs
⠇ Building modules

Is there another configuration I should consider with SVG's, typescript, or lerna? Those are the only 3 unique culprits I could think of that would require additional configuration?

Software Version(s)
TSDX ^0.13.2
TypeScript ^3.9.7
Browser
npm/Yarn npm 6.12.0
Node v12.13.0
Operating System macOS 10.13.5
@agilgur5 agilgur5 added scope: upstream Issue in upstream dependency kind: support Asking for support with something or a specific use case labels Aug 21, 2020
@agilgur5
Copy link
Collaborator

It hangs up when building modules and this is all I see on my cli:

So the Building modules step indicates that it's stuck within Rollup processing, not in TSDX source, so the issue is somewhere upstream.

I searched upstream for debug logging in Rollup but didn't have much luck, two old issues popped up that were not resolved: rollup/rollup#1215 and rollup/rollup#651

That being said, rollup-plugin-typescript2 itself does have debug level logging with its verbosity option.

I'm not sure that rpts2 is what's taking long though since 20 isn't that many and you've seen #215 and maybe #243 / #307 which were larger. The latter refers to the --transpileOnly flag that would help if rpts2 is the bottleneck. The former refers to the svgr Rollup plugin specifically for SVGs.

That's about all the information I can give you since this is really specific and upstream

@agilgur5 agilgur5 added the kind: optimization Performance, space, size, etc improvement label Aug 23, 2020
@coreybruyere
Copy link
Author

Ok I've narrowed the issue down. I can cd into each package and build in a reasonable amount of time but when I run lerna run build (runs those same build scripts) from the root of my lerna project I'm hit with massively slow build times. This issue seems to have moved away from tsdx as of now. Just leaving my discoveries here and hoping someone else has ran into this issue.

@agilgur5 agilgur5 changed the title How to debug/fix slow build times? How to debug/fix slow build times in Lerna monorepo? Aug 24, 2020
@agilgur5 agilgur5 added the topic: monorepo Related to Lerna monorepos label Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: optimization Performance, space, size, etc improvement kind: support Asking for support with something or a specific use case scope: upstream Issue in upstream dependency topic: monorepo Related to Lerna monorepos
Projects
None yet
Development

No branches or pull requests

2 participants