For anyone that arrives here with VuePress woes, let me try to ease your pain
TL;DR - Keep your VuePress site small!
If you’re starting with VuePress v2 (which uses Webpack 5), you will (hopefully) have a better time, since the newer version of Webpack is supposed to build faster and be more efficient.
VuePress 1.x is inefficient with file handling and if you have a VuePress website with any sort of versioning mechanism, try to keep the amount of versions on your site to a reasonable number. In an effort to make the site smaller and to make it easier to navigate, we’ve removed all 0.x doc versions and are striving to keep only release versions there. This approach has made our site successfully deploy again, as well as build faster and generally run faster
Here are some stats as a reference:
- Before optimization: 15-20 minute build times, ~1,300 build files generated
- After optimization: 5-6 minute build times, ~500-600 build files generated
We were even able to completely remove the Node max_old_space_size
flag, which we initially had set to 4096
and then to 8192
. The site builds successfully and is faster to work with for everyone on our team.
In my logs above, you’ll see a 137
error. This generally relates to memory allocation issues. If you run into that, try to reduce the size of your VuePress site and the amount of files it has to generate.
Another thing that would be really valuable, but VuePress seems to be lacking, are incremental builds. Having to rebuild the entire site each time for small changes is a huge waste of resources and can eat up build time minutes on your Netlify account.