-
-
Notifications
You must be signed in to change notification settings - Fork 77
Sass Globbing Won't compile w/gulp-ruby-sass #32
Comments
Author - please fix this. No Globbing support is a deal-breaker for gulp-ruby-sass |
@grayghostvisuals can you show how you use sass-globbing and what fails and how it fails? |
Bare Bones Setup
Failing means it won't compile. I'm using it correctly so I think what would be best to do is give it a try for yourself. I'm not sure if you developed Here is Chris' repo that contains the docs about sass-globbing |
any news on this? |
@sindresorhus Any results from this yet? I've been getting pinged on Twitter about this from people finding this issue and asking me if this is resolved. As of now it still won't compile for me. |
I'm not exactly sure how Sass globbing works, but could this be related to #17 ? From their docs: "Globs are always relative to the current file". It sounds like they may not be using directories from |
That sounds like a Sass glob bug. It should definitely use paths from |
I'm having similar issues with glob patterns involving having a glob pattern involving Sass: gulp.task("compile:css", function(){
return gulp.src([".app/src/sass/**/*.{sass, scss}"])
.pipe(sass())
.pipe(gulp.dest("./app/public/assets/css"));
}); No file is compiled after compilation despite knowing 100% that other tasks can pick up the glob pattern like the following watch task definition below: gulp.task("watch", function(){
gulp.watch(["./app/src/js/**/*.js"], ["compile:js"]);
gulp.watch(["./app/src/sass/**/*.{sass, scss}"], ["compile:css"]);
}); |
@grayghostvisuals Can you test this with the branch in #56? As long as the files being globbed are also globbed into the gulp task I think it should work. |
Unfortunately the project I was working on with this I'm no longer on anymore.
Is it possible for another way around this though? I mean other gulp plugins manage sass globbing just fine without globbing the files from within the gulp config. There has to a way to avoid this route…no? |
Gulp doesn't work on the file system, but on files in the stream. I don't think a gulp plugin that works correctly can glob on files that haven't been added to the stream. Can you point me at a gulp plugin that manages sass globbing correctly? I don't think gulp globbing all the files you want to have available to sass globbing is too bad. For example the app I work on sass globbs component/module and mixin files into a main.scss file. Because they all live in app/styles my gulp src would look like |
suggesting that |
Correct. What do your options look like? |
… if(gutil.env.dev === true) { var changeEvent = function(evt) { gulp.task('css', function(){ var sassFiles = gulp.src(appFiles.styles)
|
also tried various combinations of loadPath to no avail e.g.:
|
Is sass globbing native now? I thought we still needed to load a ruby On Tuesday, June 17, 2014, Iain Houston notifications@github.com wrote:
Rob Wierzbowski |
Where would the dependency be expressed? I've got the sass-globbing 1.1.0 gem installed .... would it need a config.rb file? (I think config.rb is only for compass) |
According to the docs: https://github.com/chriseppstein/sass-globbing#use-with-the-sass-command-line gulp ruby sass takes every option you give it and spits it out as a command line arg. So |
@iainhouston You have to use the require statement from your compass config https://github.com/grayghostvisuals/lemanz/blob/master/config.rb#L1 |
If things aren't working I would suggest getting closer to the metal and using Sass configuration instead of requiring compass and adding config in the compass config file. Although both should work. I've confirmed that:
sass globbing works as expected. I'm hoping to finish work on that branch soon. |
Thanks Rob. That looks more like it! Will try tomorrow. |
Code snips: gulp task return gulp.src([
'app/styles/**/*.scss',
'Gemfile'
])
.pipe($.rubySass({
bundleExec: true,
require: "sass-globbing"
})) Gemfile, should be optional. source "http://rubygems.org"
gem 'sass', '~>3.3.7'
gem 'sass-globbing', '~>1.1' Source files // app/styles/objs/obj-1.scss
@mixin bar() {
content: "bar";
}
// app/styles/objs/obj-2.scss
@mixin baz() {
content: "baz";
}
// app/styles/test.scss
@import 'objs/**/*';
body {
@include bar();
@include baz();
} Result body {
content: "bar";
content: "baz";
} |
56 landed, so closed! |
very cool. thanks for your work on this. |
Is this a feature that is currently available from npmjs? A little new to Gulp and trying to get globbing to working but struggling to understand. gulp.task('styles', function() {
return gulp.src(['assets/src/scss/**/*.scss' , 'Gemfile'])
.pipe(plugins.rubySass({
bundleExec: true,
require: "sass-globbing"
}))
.pipe(gulp.dest('assets/staging'))
}); When I run this I get:
When I run without 'Gemfile' in the source it doesn't error but I get this in my CSS file:
Not sure if my code is incorrect or I need to be using an updated build. |
We have one more feature to write before releasing another version. Try updating to the latest commit in your package.json, installing, and running again. Let me know if it works. |
Works great! Turns out I just didn't know how to grab a dependency from a github commit. added to package.json: "gulp-ruby-sass": "git://github.com/sindresorhus/gulp-ruby-sass.git#25664c03a40e66c6466dc7f117c48a8aa0307917" |
I'm trying to follow this to get globbing to work. I'm new to ruby/gulp. I'm receiving the error 'Could not locate Gemfile' when gulp-ruby-sass runs. Can anyone give me some basic instructions on how to create a Gemfile, a Gemfle.lock, what should be in those files and in which directory the should be saved? |
@jeremydouglas Use the latest version as specified in this comment: #32 (comment), but with the latest commit. If you're using Bundler and Gemfiles, look at their documentation. With the latest version you only need a Gemfile in the same directory as your gulpfile, no need to add it to your gulp.src(). |
Should it be necessary to use Bundler? Sorry, I'm a front-end guy. I don't know Ruby, I'm not really even sure what Bundler is. I've installed Bundler, now I'm getting this error after the gulp-ruby-sass task runs:
This is the task I have:
Do I need to load a sass-globbing plugin at the top of my gulp file of any sort? FWIW, sass-globbing is working fine from the command line. |
Just like with Sass, you can choose to use bundler or not. Read the bundler homepage for more information on what it is, or search for answers on Stack Overflow. Those questions aren't related to this plugin. |
Thanks, I was editing my comment while you answered. If sass-globbing works from the command line, it should work from gulp too, right? |
I don't believe you can glob from the command line, only compile a single file or a folder. Not sure what you mean exactly. |
Oh, NM, the sass-globbing sass plugin. If the plugin is installed I believe it should work with your task settings. |
Right, the sass-globbing plugin is working from the command line, then I should be able to have the below my task and not worry about having a Gemfile and Bundler, right?
|
You need to decide if you need bundler or not. Please read up on what Rob Wierzbowski On Wed, Jul 30, 2014 at 10:09 AM, Jeremy Douglas Hoover <
|
Ok, thanks for the help. |
Good luck! Rob Wierzbowski On Wed, Jul 30, 2014 at 10:13 AM, Jeremy Douglas Hoover <
|
Currently :
Won't play nice with sass-globbing v1.1.0. My setup works 100% elsewhere using the versions of Sass and Compass above plus Sass Globbing mentioned w/Grunt. This setup with gulp however fails to compile.
The text was updated successfully, but these errors were encountered: