gulp-sass icon indicating copy to clipboard operation
gulp-sass copied to clipboard

onSuccess event

Open NielsDoucet opened this issue 10 years ago • 7 comments
trafficstars

In the previous version we had an onSuccess callback function that passed back the resulting css and some stats about the running time of the compilation process. Can this be made available again in gulp-sass 2.x, or has it also disappeared from node-sass?

NielsDoucet avatar May 18 '15 12:05 NielsDoucet

I don't think I'd be interested in re-implementing onSuccess; this is Gulp and we pass the compiled CSS down through the pipe, if a user wants to work with the compiled CSS, they should do it through standard piping.

I'd consider attaching the stats info to the file object being passed down the pipe, but it doesn't give much information that Gulp doesn't have already; the only real insight it gives above and beyond what you already get with Gulp is includedFiles.

@dlmanning @Keats thoughts on that?

Snugug avatar May 18 '15 12:05 Snugug

We like to use the stats to see when it is feasible to use sync vs async compilation. When too many files get pushed in the pipeline together, the concurrent compilation breaks down the system and makes compilation go slower instead of faster. The easiest way to see this difference is a compile duration per file, exactly what is available in the stats object. It's not actually the css i'm that interested in.

Gulp-sass would just be the wrapper that passes options to node-sass and returns the result as is. Doesn't look like going beyond its intended behavior to me.

NielsDoucet avatar May 18 '15 17:05 NielsDoucet

Like I said, I'd consider adding the stats object to the file being passed down the pipe, that way it can be retrieved in following functions. Looking for feedback from the other maintainers

Snugug avatar May 18 '15 18:05 Snugug

As long as it doesn't interfere with basic usage, I'm ok with it

Keats avatar May 18 '15 19:05 Keats

I added it before, so I don't suppose I have any objections to adding it again.

dlmanning avatar May 18 '15 20:05 dlmanning

Any updates on this? Need a PR?

mattidupre avatar Mar 16 '16 06:03 mattidupre

I need onSuccess callback function :( , it helpful when build file !!!

Please add callback onSuccess to gulp-sass 3.x

kytosai avatar Dec 06 '17 08:12 kytosai