question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compile times hit 30 seconds or higher for simple changes when using ng serve

See original GitHub issue

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

angular-cli: 1.0.0 node: 6.9.2 os: darwin x64 @angular/animations: 4.0.0 @angular/common: 4.0.0 @angular/compiler: 4.0.0 @angular/core: 4.0.0 @angular/forms: 4.0.0 @angular/http: 4.0.0 @angular/platform-browser: 4.0.0 @angular/platform-browser-dynamic: 4.0.0 @angular/router: 4.0.0 @angular/cli: 1.0.0 @angular/compiler-cli: 4.0.0

Repro steps.

I’ve not been able to pinpoint this exactly but it seems as if the issue comes whenever changing things in the shared folder.

My folder structure looks like this (starting in /app):

- routes
- shared
  - animations
  - components
  - directives
  - constants
  - interfaces
  - guards
  - services
  - validators
  - pipes
  - modules
    - components.module.ts // Imports and exports all components in the components folder
    - shared.module.ts // Imports and exports all pipes and directives as well as the necessary angular modules that each page module will need in order to work

When changes things in the routes folder the compile does not take as long, but it can still be between 5-15 seconds. When changing something in the components folder for example, I need to sit and wait for at least 20 seconds, even for small changes such as changing a number from a 0 to a 1. Which is just ridiculous.

Desired functionality.

I’m expecting compile times to not be above 10 seconds, regardless of the size of the change.

Mention any other details that might be useful.

I didn’t notice this change in the 1.0.0-beta.26 version which I was using earlier with the exact same structure. This began when I switched over to angular 4 and the non-beta version of the CLI (1.0.0). I can’t provide a repo unfortunately since the code is not open source, but hopefully this is enough in order to investigate.

Each folder in the shared folder can have quite a lot of files in them. components and interfaces are especially large since they can have nested folders about 3-4 levels deep. Right now the components folder have about 20 components in it and the more I add the more it seems to slow down.

If you require further information just ask, I would really love for this one to get solved as quickly as possible.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:10
  • Comments:24 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
Son-Lamcommented, Mar 8, 2018

Hello, I am using v 1.7.0 and still having the same issue. It takes about 35 sec for me.

3reactions
intellixcommented, Jun 26, 2017

nobody said it yet but apparently Webpack 2.3.3 contained a big performance regression as mentioned here: https://github.com/webpack/webpack/issues/4863 The guys are waiting for a fix to land in 3.0.x before updating to it and I’m guessing that’ll fix this issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

NG serve takes long time to start - Stack Overflow
In my case (Angular v. 11), ng serve takes about 1 minute to serve the app, but the ng-serve --source-map=false takes somewhere from...
Read more >
How To Speed Up Angular Development and Reduce ...
However, the more your app grows, the longer your compilation times may become. This makes writing code more cumbersome and reduces your developer ......
Read more >
How to speed up your Angular builds - Bitovi
First, increase Node's memory limit. This consumes more RAM, but it helps. Second, keep ahead-of-time (AOT) compilation turned on. Builds will ...
Read more >
Getting Started With Angular Using the Angular CLI
Starts a local web server on a port of your choice. Watch for changes in the files and reload the browser on change....
Read more >
How the Angular Compiler Works
Compilation Flow. The main goal of ngc is to compile TypeScript code while transforming recognized Angular decorated classes into more efficient ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found