aaronjensen / sass-media_query_combiner

MIT License
168 stars 16 forks source link

Using in combination with gulp-ruby-sass #11

Closed wayferer closed 9 years ago

wayferer commented 10 years ago

Hi there,

I'm new to all this so excuse me if this is the wrong place to ask but I am having an issue with my media queries not being combined. I have the following in my gulpfile:

gulp.task('sass',function () {
    gulp.src('_scss/main.scss')
        .pipe(sass({
            loadPath: ['_scss'],
            require: ['sass-media_query_combiner'],
            style: "compressed",
            trace: true,
            sourcemap: true,
            sourcemapPath: "../../../_scss",
            noCache: true
        }))
        .pipe(gulp.dest('resources/css'));
});

Any thoughts?

aaronjensen commented 10 years ago

hm, I've not used gulp to do it, sorry. It seems like it should work if that require directive is equivalent to sass -r ...

Does it error out or just not combine? Could you try compiling from the command line w/ sass -r sass-media_query_combiner?

wayferer commented 10 years ago

Thanks for the reply. I tried finding out if it is equivalent but was unable to. I'm pretty new to Gulp so still trying to get my head around it. I normally manually built using the build tool in Sublime Text 2 so I know it works from the command line fine. There are no errors being thrown from what I can tell, it just doesn't combine. So I'm assuming that it's just not being called.

I tried posting an issue in the gulp-ruby-sass repo but haven't heard anything yet, so was hoping you might be able to shed some light.

aaronjensen commented 9 years ago

@wayferer it seems like the problem is actually sourcemap: true. If you set that to false then it works fine.

aaronjensen commented 9 years ago

Unfortunately, supporting source maps would take quite a bit of work and I probably won't get to it, sorry :/

wayferer commented 9 years ago

Tested it and you're correct. Thanks for your help :)

aaronjensen commented 9 years ago

@wayferer you may want to check out https://github.com/hail2u/node-css-mqpacker