Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onSuccess event #279

Open
NielsDoucet opened this issue May 18, 2015 · 7 comments
Open

onSuccess event #279

NielsDoucet opened this issue May 18, 2015 · 7 comments
Assignees
Milestone

Comments

@NielsDoucet
Copy link

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?

@Snugug
Copy link
Collaborator

Snugug commented May 18, 2015

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?

@NielsDoucet
Copy link
Author

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.

@Snugug
Copy link
Collaborator

Snugug commented May 18, 2015

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

@Keats
Copy link
Collaborator

Keats commented May 18, 2015

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

@dlmanning
Copy link
Owner

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

@Snugug Snugug added this to the 2.1.0 milestone Jun 24, 2015
@Snugug Snugug self-assigned this Jun 24, 2015
@mattidupre
Copy link

Any updates on this? Need a PR?

@kytosai
Copy link

kytosai commented Dec 6, 2017

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

Please add callback onSuccess to gulp-sass 3.x

WraithKenny added a commit to WraithKenny/gulp-sass that referenced this issue Jul 21, 2021
The `stats` object that's returned from the sass compiler contains some interesting info, particularly `includedFiles` which can be used to develop smarter watchers. Related to dlmanning#279, fixed dlmanning#428
niksy pushed a commit to niksy/gulp-sass that referenced this issue Jan 24, 2022
The `stats` object that's returned from the sass compiler contains some interesting info, particularly `includedFiles` which can be used to develop smarter watchers. Related to dlmanning#279, fixed dlmanning#428
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants