ionic serve will take anywhere from 30 seconds to 3 minutes to compile and prepare to serve changes on every change. Is this normal or is something wrong with my setup? I’m using Typescript btw.
The same for me. Very slow and not loaded into the browser (chrome).
although the project is built.
So I must stop the server and restart it.
Cordova CLI: 6.0.0
Ionic2 Version: 2.0.0-beta.22
Ionic CLI Version: v2.0.0-beta.22
Gulp version: CLI version 3.9.1
Node Version: v0.12.7
OS: Windows 10pro.
I experience this issue as well with blank typescript project created via
ionic start myApp blank --v2 --typescript
The recompile time is cca 10 seconds.
With another project which already has cca 15 screens and components, the recompile time is around 30-40 seconds.
Cordova CLI: 5.3.3 Gulp version: CLI version 3.9.1 Gulp local: Local version 3.9.1 Ionic Version: 2.0.0-beta.6 Ionic CLI Version: 2.0.0-beta.22 Ionic App Lib Version: 2.0.0-beta.12 OS: Distributor ID: Ubuntu Description: Ubuntu 14.04.3 LTS Node Version: v0.12.7
I tried most of the options of webpack devtool option but it has no impact on compile time.
Actually, what are the compile times we expect from
ionic serve? Maybe also other people struggle with 10s reload time, but they find it normal. Personally I believe the reload time should take no more than 100ms for medium size app (up to 30 screens), taking into account the power of nowadays CPUs and amount of RAM (e.g. intel core i3 and 8GB of ram in my case).
If using webpack means you’re using the
ionic-gulp-webpack package? today i updated that one and the compile time drop from 40s first and 28s consecutive ones, to 17s first and 5~6s consecutive ones, try updating that one.
thanks for response.
I found this line in
so it seems I use the latest version of ionic-gulp-webpack-build.
Out of curiosity I replaced
but the compile times are ~ the same.
Maybe is the version of the ionic framework you’re using, i reverted to beta.6 and the compile time went up again even after updating the
ionic-gulp-webpack plugin, if you can try the update and see if that improves the compile time.
Same Problem here! i think the problem was present also in beta.6
Not sure if there’s something similar for Webpack but for Browserify you could disable the sourcemaps to speed-up the rebuilds:
falsewill disable sourcemaps and drastically speed up your rebuilds when watching.
I’m struggling with painfully slow compile times and would like to speed things up. But there doesn’t appear to be a gulpfile.js in new ionic 2 projects. Where would this option be set if not in a gulpfile? Thx
I used 3 separate rollup config files under node_modules/@ionic/app-scripts/config/ to get this done. One for creating the core.js, another for app.js, and the other needed for generating www/build/main.css. I had to use the “external” and “globals” rollup feature to accomplish all this. Not sure if this is the right way to go about this, but it seems to work with the tabs starter project.
Andresa8, thanks for this. I commented out the line
in ngc.config.js and that sped things up significantly.I can’t figure out how to split things up like you did though. Do you mind sharing your setup?
It seems like a really great solution.
Could you please share with us how you did it ?
@evandillon did commenting out the line in ngc.config have any side effects e.g. templates not update etc?
Care to share, suffering here!
@fabrizio5680 i have updated my app-scripts to version .39 and has seen great improvement in terms of ionic serve. maybe you can try it out as well.
Brilliant, huge improvement, thanks!
How is the performance of ionic serve command with “@ionic/app-scripts”: “0.0.48”, or “@ionic/app-scripts”: “0.0.47”,?
I am experiencing very slow.
Could you please share how to achieve this?
I am using 2.0.0 . Where is ngc.config.js ?
I only see ./node_modules/@ionic/app-scripts/dist/ngc.js and ngc.d.ts