Compile times hit 30 seconds or higher for simple changes when using ng serve
See original GitHub issueBug 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:
- Created 6 years ago
- Reactions:10
- Comments:24 (7 by maintainers)

Top Related StackOverflow Question
Hello, I am using v 1.7.0 and still having the same issue. It takes about 35 sec for me.
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