# AoT/rollup compilation slows down livereload. Can it be disabled when using ionic serve?

**URL:** <https://forum.ionicframework.com/t/aot-rollup-compilation-slows-down-livereload-can-it-be-disabled-when-using-ionic-serve/64907>\
**Category:** ionic-v3\
**Created:** [September 29, 2016, 2:25am UTC](https://forum.ionicframework.com/t/aot-rollup-compilation-slows-down-livereload-can-it-be-disabled-when-using-ionic-serve/64907 "2016-09-29T02:25:12Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![jba](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/jba/32/8231_2.png) [@jba](https://forum.ionicframework.com/u/jba)\
**Post date:** [September 29, 2016, 2:25am UTC](https://forum.ionicframework.com/t/aot-rollup-compilation-slows-down-livereload-can-it-be-disabled-when-using-ionic-serve/64907/1 "2016-09-29T02:25:12Z")

</div>

I’ve noticed that the AoT compilation step slows down the build process significantly. Running `ionic serve` with beta11, the browser used to refresh after a file save in under 2 seconds, but now running rc0 I find myself waiting over 10 -12 seconds each time. Now I see the following message output which is different from the beta

```auto
...
[22:16:16] bundle dev update started ...
[22:16:26] bundle dev update finished in 9.73 s
...

```

I assume this `bundle dev` step is the AoT compiler. While I understand the advantages of using AoT compilation, it isn’t necessarily advantageous to use it when using `ionic serve` and livereload. When developing an ionic app and frequently reviewing small changes in the browser, individual builds are often used one time before being overwritten by the next small change.

It doesn’t make sense to use an optimization step that shaves a fraction of a second off the browser load time in exchange for adding 10 seconds to the build time when that build is going to be used once. It simply increases the total wait time.

Anyhow my point is It would be nice to have an option to turn this step off, either a command line switch or a config file option. I have been trying to figure out how to do this but I haven’t been able to find any documentation on how to do so.

Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![fishgrind](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/fishgrind/32/103232_2.png) [@fishgrind](https://forum.ionicframework.com/u/fishgrind)\
**Post date:** [September 29, 2016, 9:52pm UTC](https://forum.ionicframework.com/t/aot-rollup-compilation-slows-down-livereload-can-it-be-disabled-when-using-ionic-serve/64907/2 "2016-09-29T21:52:33Z")

</div>

I second that, it’s a pain now, just changing html takes really long!

---

<div class="post-metadata">

**Author:** ![mayteio](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@mayteio](https://forum.ionicframework.com/u/mayteio)\
**Post date:** [September 29, 2016, 10:01pm UTC](https://forum.ionicframework.com/t/aot-rollup-compilation-slows-down-livereload-can-it-be-disabled-when-using-ionic-serve/64907/3 "2016-09-29T22:01:12Z")

</div>

painfully slow! I also assume it has to do with rollup taking out all the unnecessary components.

---

<div class="post-metadata">

**Author:** ![jba](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/jba/32/8231_2.png) [@jba](https://forum.ionicframework.com/u/jba)\
**Post date:** [September 29, 2016, 10:02pm UTC](https://forum.ionicframework.com/t/aot-rollup-compilation-slows-down-livereload-can-it-be-disabled-when-using-ionic-serve/64907/4 "2016-09-29T22:02:08Z")

</div>

Also, I’ve noticed a number of other posts complaining about broken builds with rc0 that seem to pertain to problems with Rollup (I am experiencing one such problem now `angular2-moment`.)

for example, see

> [@RC.0: how do you use the Chrome Debugger with the Rollup bundler?](https://forum.ionicframework.com/t/rc-0-how-do-you-use-the-chrome-debugger-with-the-rollup-bundler/64955):
>
> I must be doing something wrong. I am playing with the new RC.0 release and I’m trying to inspect my code from the Chrome Debugger. I use npm run build --dev to build the project. I can see source maps for .tmp/app but not for .tmp/pages/home. The code is in ‘build/main.js’ but I can’t seem to set breakpoints within. Plus it takes a loooong time to load the main.js scripts into the debugger. also, I can’t seem to inspect the local variables, example: [breakpoint] var sorted = \_.sortBy(phot…

> [@Rc.0 Serve Fail on Rollup Step (ES2015 project)](https://forum.ionicframework.com/t/rc-0-serve-fail-on-rollup-step-es2015-project/64870):
>
> [13:54:47] ionic-app-scripts 0.0.23 [13:54:47] watch started ... [13:54:47] build dev started ... [13:54:47] clean started ... [13:54:47] clean finished in 27 ms [13:54:47] copy started ... [13:54:47] typescript compiler started ... [13:54:47] copy finished in 102 ms [13:54:48] typescript compiler ready in 1.29 s [13:54:48] bundle dev started ... [13:54:48] Error: Could not resolve entry (./.tmp/app/main.dev.js) at [project]/node\_modules/rollup/dist/rollup.js:8602:28 at proces…

Being able to disable this AoT/Rollup step would allow development/testing to continue until the bundling problems could be resolved at a later date.

---

<div class="post-metadata">

**Author:** ![intelinc](https://avatars.discourse-cdn.com/v4/letter/i/b5a626/32.png) [@intelinc](https://forum.ionicframework.com/u/intelinc)\
**Post date:** [September 30, 2016, 12:49am UTC](https://forum.ionicframework.com/t/aot-rollup-compilation-slows-down-livereload-can-it-be-disabled-when-using-ionic-serve/64907/5 "2016-09-30T00:49:40Z")

</div>

My builds get slower over time. Almost looks like a memory leak. The livereload node process starts using \>100% CPU after I have been working for a while. Builds get consecutively slower until a build eventually errors out (if I have the patience to wait that long). At this point, I just quit the process and restart it periodically. Agree that it would be nice to disable optimizations.

---

<div class="post-metadata">

**Author:** ![desenvolvimento\_esal](https://avatars.discourse-cdn.com/v4/letter/d/ecccb3/32.png) [@desenvolvimento\_esal](https://forum.ionicframework.com/u/desenvolvimento_esal)\
**Post date:** [October 8, 2016, 4:56pm UTC](https://forum.ionicframework.com/t/aot-rollup-compilation-slows-down-livereload-can-it-be-disabled-when-using-ionic-serve/64907/6 "2016-10-08T16:56:53Z")

</div>

I´m getting 3 - 5s to build.

---

<div class="post-metadata">

**Author:** ![btsiders](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/btsiders/32/101172_2.png) [@btsiders](https://forum.ionicframework.com/u/btsiders)\
**Post date:** [October 13, 2016, 7:56pm UTC](https://forum.ionicframework.com/t/aot-rollup-compilation-slows-down-livereload-can-it-be-disabled-when-using-ionic-serve/64907/7 "2016-10-13T19:56:31Z")

</div>

My `bundle dev update` and `templateUpdate` times start out fast but get slower and slower while `ionic serve` is running. I have to quit it and run again to speed back up. I usually do that once the numbers get around 30 seconds, but yesterday I did have it go well over 120 seconds a couple of times. Not fun when all I did was update one element in an HTML file.

---

<div class="post-metadata">

**Author:** ![danbucholtz](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/danbucholtz/32/99512_2.png) [@danbucholtz](https://forum.ionicframework.com/u/danbucholtz)\
**Post date:** [October 14, 2016, 3:19am UTC](https://forum.ionicframework.com/t/aot-rollup-compilation-slows-down-livereload-can-it-be-disabled-when-using-ionic-serve/64907/8 "2016-10-14T03:19:44Z")

</div>

Can you run `npm install @ionic/app-scripts@latest`? Or at least do this tomorrow, since we’re in the process of releasing a new version 🙂

This issue should be fixed.

Thanks,  
Dan

---

<div class="post-metadata">

**Author:** ![rastographics](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@rastographics](https://forum.ionicframework.com/u/rastographics)\
**Post date:** [October 18, 2016, 7:01pm UTC](https://forum.ionicframework.com/t/aot-rollup-compilation-slows-down-livereload-can-it-be-disabled-when-using-ionic-serve/64907/9 "2016-10-18T19:01:08Z")

</div>

In comparison to Ionic 1, this problem has been a huge step backward for my developer productivity.

Waiting anywhere from 5 to 30 seconds between code/html changes and being able to view them bring the flow of development to a grinding crawl.

Please point us to a way we can de-optimize the bundles for running “serve”.

One of the big selling points for Ionic vs native development used to be “no compile step” when developing and previewing the code. Of course, there needs to be some compile when using typescript, but all the optimization, tree-shaking, minifying, should be unnecessary at development time.

Can we just spit out a huge bundled js file nice and fast, with no optimizations? And if we split out the vendor code to a separate file from our app code, then that bundle can be created even faster.

Just my $0.02

---

<div class="post-metadata">

**Author:** ![itrethan](https://avatars.discourse-cdn.com/v4/letter/i/f4b2a3/32.png) [@itrethan](https://forum.ionicframework.com/u/itrethan)\
**Post date:** [November 4, 2016, 4:38am UTC](https://forum.ionicframework.com/t/aot-rollup-compilation-slows-down-livereload-can-it-be-disabled-when-using-ionic-serve/64907/10 "2016-11-04T04:38:32Z")

</div>

Did anybody fix this? It’s on rc2 now, but the build is still really slow due to the AOT.

In ionic serve, every change took me about 8s to refresh the page, it’s painful.

---

<div class="post-metadata">

**Author:** ![Kashban](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/kashban/32/104500_2.png) [@Kashban](https://forum.ionicframework.com/u/Kashban)\
**Post date:** [November 8, 2016, 10:29am UTC](https://forum.ionicframework.com/t/aot-rollup-compilation-slows-down-livereload-can-it-be-disabled-when-using-ionic-serve/64907/11 "2016-11-08T10:29:23Z")

</div>

To make things worse many third party libraries are not AOT ready (missing a metadata file) and such as fail to compile. I need to switch back to non AOT even for production because I require those libraries.
