straker/gulp-livingcss

Issue with declaring options in gulp

Closed this issue · 2 comments

Here's my original gulp task:

gulp.task('livingcss', function(){
  return gulp.src('src/css/style.css')
    .pipe(livingcss())
    .pipe(gulp.dest('dist'))
});

Everything works fine but when I try to tell it to grab another template to build off of using the options params it seems to create an issue, new gulp task:

gulp.task('livingcss', function(){
  return gulp.src('src/css/style.css')
    .pipe(livingcss('dist', {template: 'template/template.hbs'}))
    .pipe(gulp.dest('dist'))
});

command line output

λ gulp livingcss
[16:02:26] Using gulpfile ~\projects\living-style-guide\gulpfile.js
[16:02:26] Starting 'livingcss'...
Error: ENOENT: no such file or directory, open 'C:\Users\dflickinger\projects\src\css\style.css'
    at Error (native)
Error: ENOENT: no such file or directory, open 'C:\Users\dflickinger\projects\src\css\style.css'
    at Error (native)
[16:02:26] Finished 'livingcss' after 72 ms

The path should be 'C:\Users\dflickinger\projects\living-style-guide\src\css\style.css'

Threw mud at the wall to see what would stick and eventually got this to work

gulp.task('livingcss', function(){
  return gulp.src('src/css/style.css')
    .pipe(livingcss('', {template: 'template/template.hbs'}))
    .pipe(gulp.dest('dist'))
});

Not sure why declaring the destination would screw this up. I'm glad I got it working but I'm trying to understand whats going on here. If declaring options the module definitely wants a path declared (or atleast an empty string) but declaring the correct path causes the above ENOENT error

Thanks for the bug. Should be fixed in 2.0.5. Let me know if there's any problems.

Re-open if it's still a problem.