sproutcore / build-tools

SproutCore Build Tools
12 stars 7 forks source link

BT crashes with big combined css files with out-of-memory error #46

Closed mauritslamers closed 9 years ago

mauritslamers commented 9 years ago

Because of the amount of memory the cssmin package takes when minifying a css file, it can happen that the BT crashes with an out of memory error during a build.

This problem came to light when bringing in code which automatically includes sass partials (css files beginning with an underscore, such as _theme.css). In the current setup, the BT will always parse every css file in a standalone way, which makes it necessary to include all partials in the single css file. When combining multiple css files, this leads to duplication of all the partials. The more files there are to combine, the more duplicates of the partials there will be.

The current solution is to mark these partials with comments and filtering the combined file to only include every partial once. While this solves the problems for the moment, it is important to mark this as a potential weakness, and as a reminder that when large apps are processed with much css, it can happen that the minification by cssmin will break a build.

This issue is created for documentation purposes and will be closed for now, as there is a fix in place. If anyone runs into this problem again, please reopen!