-
Notifications
You must be signed in to change notification settings - Fork 311
Webpack 3.7.0 and above slow build #1280
Comments
I have the same problem. My production build went from 12 minutes to 26 minutes after upgrading to the new webpack that I got from [email protected] |
I have the same problem, with a 70+ module ionic app my build time is around 70s. But I tried to use Webpack 3.8.1 directly in my dev dependencies, which cuts the build time in half using Webpack 3.7.1 as transitive dependency.
3.8.1
ionic info
|
A fix for me was using [email protected] Also I can't do the |
I see, since [email protected] is dependent on webpack 3.8.1 so adding webpack 3.6.0 separate will not help anymore |
Hi @danbucholtz, would like to check whether this issue has to wait to be resolved at webpack's end since it is not resolved in the recent app script update? The long build time makes app script unusable. |
@tanzl88 I also opened an issue at the webpack repo They are asking for a repo that has the problem for them to check, but I am sadly not able to reproduce on a new ionic app and can't send my company's app. Do you have a sample repo that you can give them to check? |
We'll take a look. This is sort of strange. I wonder why that would be. Worst case, I don't see any reason we couldn't go back to 3.6.0 potentially (not sure if that support ModuleConatenationPlugin or not). Thanks, |
@dmastag are you using |
@dmastag your build was 12 minutes? How?! |
@masimplo yes, actually I am
So are you suggesting that I set the @mlynch correct The following are the builds using gitlab-ci Using [email protected] Using [email protected] |
That's crazy. Are you doing anything special? What does your app look like (i.e. anything that would cause builds to be that slow)? |
Not sure, I have 238 lazy loaded IonicPages Though this app has been using ionic since |
@dmastag okay that explains it 😅 Why so many pages? Could probably cut down on it if you generalize them somehow, but I don't know your app |
Yeahh, maintenance has become quite difficult since its an enterprise app with 10-15 developers working on it 😃 But still, this doesn't explain why webpack 3.6.0 to 3.8.1 is such a huge jump in build time 😢 |
@dmastag do you have any entries in your package.json scripts looking like these?
these should address both build and ionic serve. |
@masimplo Yes I do, because I get a exceed memory error if I don't use that |
I had 2048 on these two and was getting a really slow build and sometimes out of memory exceptions. I raised them to 4096 and builds are back to normal build times. Did you try setting it to something like 8GB? You have a large project so it wouldn't be the weirdest thing to use a lot of memory. |
@dmastag For our app, I needed to allocate 8GBs for node to get a successful build after updating to But either way, upgrading webpack/ionic-app-scripts shouldn't yield such drastic build time difference, and I believe many others with similarly non-trivial size apps have been facing the same issue #1247 #1076 #1036. I can't help but think upping the node memory limit as the app size inevitably increases is just putting a band-aid to the problem. We are currently stuck on |
I have the same problem with @dmastag , my app have nearly 300 lazy loaded IonicPages, after upgrading to [email protected] is dependent on webpack 3.8.1, and production build time went from 10 minutes to 30 minutes. |
Do you have any performance improvement ? |
Hello everybody. I know I am late to the convo... BUT, my slow webpacks came from upgrading @ionic/[email protected] to @3.1.7-201801172029.... So, by uninstalling app-scripts and reinstalling version 2.1.4, I was able to go from 70 second build times to 13 second build times and, best of all, 7 second incremental build times. So, try the following and see if it helps!!!
Hope it helps! |
I totally confirm that downgrading from (you need to install would be good to understand why :) |
Hey all. We're aware of this, but we don't have a solution right now. If 2.1.4 works for you, awesome. With Ionic 4's angular support, we don't need app scripts anymore, we will use the ng cli toolchain. I'm not saying that will solve these problems because some are inherent to the Angular build process, but it should help. Stay tuned for that, we're getting close to the alpha release this Spring. |
@mlynch do you know what we lose in using I'm so glad that you decided to use ng cli in next version. Good choice, IMHO 👍 Good luck for Ionic 4. We really wait for it, as Ionic 3 is stuck with annoying bugs :( |
On the choice: yea, and it's much less for us to have to maintain, so we can focus more on the components! You shouldn't lose much, at this point ng cli has overlapped with app scripts pretty well |
I confirm that with version If I try one of |
I have a 8000+ lines template and webpack used more than 3 hours…… (with --prod) |
I've got about 170 modules and moving to version 3.1.2 of @ionic/app-scripts cut my build time down from about 5 minutes to 3 and a half minutes. Still not great but better... |
Any news on when app-scripts will look into this (or if it's confirmed that it is instead webpack's issue)? I can confirm that using app-scripts 3.1.2 makes webpack work approx. 30x faster for both builds and live reloads (live reload average time of 60s down to 2s). Will not be upgrading app-scripts beyond 3.1.2 until that is fixed, obviously an insane downgrade in performance to upgrade to 3.1.7. |
Same here, 3.1.2 works while 3.2.0 takes forever. |
I upgraded ionic cli to 4.3.0 yesterday, and use ionic-app-scripts 3.2.0, webpack 3.8.1. Webpack took 180 seconds in --prod build mode, that took about 20 minutes before. I am pretty happy with the latest version.Make sure change the memory setting after updating. |
@zheng17 awesome |
Hi @dmastag , sorry for confusing you. I check the package version of webpack again on my local, the version is 3.8.1. I used wrong commnad 'npm view webpack version'. |
Thanks @zheng17 |
i toke 30min using --prod, build scripts version is: 3.2.0 |
It's nearly 2020 and the problem still show up. I have an app with more than 100 pages, and I am not using lazyloading. I've managed to solve this issue by running ionic cordova build android --aot --minifyjs --minifycss For more information #1426 |
Short description of the problem:
When webpack is updated to 3.7.0 and above, webpack build step takes much longer time and more memory.
What behavior are you expecting?
Webpack build step should be almost identical after update.
Debug mode ionic serve log. Identical project codes and npm packages except webpack.
Webpack 3.7.1
Webpack step is 1 minute slower and use ~200MB more memory compared to webpack 3.6.0
Webpack 3.6.0
Which @ionic/app-scripts version are you using?
3.0.0
The text was updated successfully, but these errors were encountered: