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

Error on plugins.rubySass #5

Closed
joserprieto opened this issue May 24, 2016 · 3 comments
Closed

Error on plugins.rubySass #5

joserprieto opened this issue May 24, 2016 · 3 comments

Comments

@joserprieto
Copy link

joserprieto commented May 24, 2016

On this form:

var sassFiles =
    gulp.src(
        appFiles.sassStyles
    )
    .pipe(
        plugins.rubySass(
            {
                style: sassStyle,
                sourcemap: sourceMap,
                precision: 2
            }
        )
    )
    .on('error',
        function(err) {
            new gutil.PluginError(
                'CSS',
                err,
                {
                    showStack: true
                }
            );
        }
    );

I got an error; in doc of gulp-ruby-sass:

https://github.com/sindresorhus/gulp-ruby-sass

You can see:

Usage
sass(source, [options])

So, with a few changes made:

var sassFiles =
    plugins.rubySass(
        appFiles.sassStyles,
        {
            style: sassStyle,
            sourcemap: sourceMap,
            precision: 2
        }
    )
    .on('error',
        function(err) {
            new gutil.PluginError(
                'CSS',
                err,
                {
                    showStack: true
                }
            );
        }
    );

Works fine for me.

$ npm --version
3.8.6

package.json

"devDependencies": {
    "event-stream": "^3.3.2",
    "gulp": "^3.9.1",
    "gulp-autoprefixer": "^3.1.0",
    "gulp-combine-media-queries": "^0.2.0",
    "gulp-concat": "^2.6.0",
    "gulp-cssmin": "^0.1.7",
    "gulp-load-plugins": "^1.2.4",
    "gulp-rename": "^1.2.2",
    "gulp-ruby-sass": "^2.0.6",
    "gulp-size": "^2.1.0",
    "gulp-uglify": "^1.5.3",
    "gulp-util": "^3.0.7",
    "gulp.spritesmith": "^6.2.1"
  }

Regards.

@mikestreety
Copy link
Owner

Thanks for this - mind making a PR?

On a side note, I'm currently working on documenting and publishing my latest gulpfile which has advanced from this somewhat - I actually switched to gulp-sass as I found it was faster - https://www.npmjs.com/package/gulp-sass

return gulp.src(src + '*.scss')
        .pipe($.sass({
            precision: 3,
            errLogToConsole: false,
            onError: function(err) {
                var file = err.file.replace(new RegExp('/.*(?=/build)/'), '');
                $.gutil.log($.gutil.colors.red('[problem]'), err.message + ' on line ' + err.line + ' in ' + file);
            }
        }))
        .on('error', function(err){
            errorEvent(this, err)
        })

@joserprieto
Copy link
Author

Yes, i think that is better to use gulp-sass; in fact, gulp-ruby-sass made me angry yesterday... ;)

I think that a PR isn't neccesary; more simple if you update the gulpfile; as you want :)

Regards.

@mikestreety
Copy link
Owner

Thanks. Will close this but reference it in the readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants