ng serve recompile time very slow

See original GitHub issue

Using ‘ng serve’ the webpack compile and recompile on code changes takes sometimes more than a minute.

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: 7.6.0 os: darwin x64 @angular/common: 4.0.3 @angular/compiler: 4.0.3 @angular/core: 4.0.3 @angular/forms: 4.0.3 @angular/http: 4.0.3 @angular/platform-browser: 4.0.3 @angular/platform-browser-dynamic: 4.0.3 @angular/router: 4.0.3 @angular/cli: 1.0.0 @angular/compiler-cli: 4.0.3

Repro steps.

  1. ng serve
  2. make change to any file (json, ts, html)
  3. wait for browser to reload…

The log given by the failure.

$xxxx ng serve ** NG Live Development Server is running on http://localhost:4200 ** Hash: 15921d5ca032c405df0a
Time: 43310ms chunk {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 231 kB {5} [initial] [rendered] chunk {1} main.bundle.js, main.bundle.js.map (main) 389 kB {4} [initial] [rendered] chunk {2} scripts.bundle.js, scripts.bundle.js.map (scripts) 515 kB {5} [initial] [rendered] chunk {3} styles.bundle.js, styles.bundle.js.map (styles) 11.4 kB {5} [initial] [rendered] chunk {4} vendor.bundle.js, vendor.bundle.js.map (vendor) 3.61 MB [initial] [rendered] chunk {5} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered] webpack: Compiled successfully. webpack: Compiling… Hash: 74ff0fd808586e648c85
Time: 52972ms chunk {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 231 kB {5} [initial] chunk {1} main.bundle.js, main.bundle.js.map (main) 389 kB {4} [initial] [rendered] chunk {2} scripts.bundle.js, scripts.bundle.js.map (scripts) 515 kB {5} [initial] chunk {3} styles.bundle.js, styles.bundle.js.map (styles) 11.4 kB {5} [initial] chunk {4} vendor.bundle.js, vendor.bundle.js.map (vendor) 3.61 MB [initial] chunk {5} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] webpack: Compiled successfully.

Desired functionality.

Compile and reload in 3-5 seconds or so

Mention any other details that might be useful.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:8
  • Comments:21 (3 by maintainers)

github_iconTop GitHub Comments

49reactions
chrillewoodzcommented, May 21, 2017

I have this problem too without having any images or nothing, just modules and stuff. When changing a line of css sometimes it can take 30 sec to recompile. Really, really annoying. Something is clearly wrong somewhere, but I can’t pinpoint what could be causing it as I’m following the official styleguide and best practices in general when writing my modules/components etc.

18reactions
tlxdevcommented, Apr 16, 2019

@BambiB no offense, but no serious developer should be developing on a HDD nowadays

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 >
ng serve and ng build is very slow #42100 - GitHub
Now everything is very slow. Even recompiling simple text changes take much time. Deploy to production is extreme slow.
Read more >
ng serve - slow as hell! : r/Angular2 - Reddit
I've just updated my major project to v12 and I'm running ng serve to view css changes but it's taking too long to...
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 >
ng serve - Angular
Option Description Value Type Default Value ‑‑hmr Enable hot module replacement. boolean false ‑‑host Host to listen on. string localhost ‑‑open Opens the url in default...
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