at-import / node-sass-import-once

Eyeglass style Import Once, but for all the things!
Other
94 stars 23 forks source link

Async converted to sync #23

Open designstorming opened 8 years ago

designstorming commented 8 years ago

When dealing with large number of files (scss) which are deeply nested, readFirstFile simply halts after 4th file. Probably, it opens the same file twice and it halts at second file until it's closed (which never happens, for me, for unknown reason). Anyway, it's converted into readFileSync

xzyfer commented 8 years ago

This is due to a known node-sass issue due to a libuv (node) limitation. https://github.com/sass/node-sass/issues/857

The official work around is to set process.env.UV_THREADPOOL_SIZE to value > 4.

I suggest add the following to the file calling node-sass.

process.env.UV_THREADPOOL_SIZE = Math.ceil(Math.max(4, require('os').cpus().length * 1.5));