0

I'm trying to run Gulp Sass for all of my files in a folder and its subfolders and keep the css results at the path where the scss file is.

When I run this

var filter = filters(['*', '!app/css/skins/color-vars-template.scss',     '!app/css/skins/skin-template.scss']);
gulp.task('sass', function () {
    gulp.src('app/css/*.scss')
        .pipe(filter)
        .pipe(sass())
        .pipe(gulp.dest("app/css"))

});

I have the css compiled files in the app/css folder.

Before

After

Now when I run this

var filter = filters(['*', '!app/css/skins/color-vars-template.scss',     '!app/css/skins/skin-template.scss']);
gulp.task('sass', function () {
    gulp.src('app/**/*.scss')
        .pipe(filter)
        .pipe(sass())
        .pipe(gulp.dest("app/**/*"))

});

I want to compile all of the scss files and keep the css files in the folder where the scss file is however nothing happens.

CSS files not appearing

billaraw
  • 938
  • 1
  • 7
  • 28

1 Answers1

1

It looks like you could just simplify your gulp.dest to get file path you want.

  • change: .pipe(gulp.dest("app/**/*"))
  • to: .pipe(gulp.dest("app"))

Explained here: https://stackoverflow.com/a/23249384/284091

The destination doesn't need to be dynamic as the globbed path is used for the dest as well. Simply pipe to the same base directory you're globbing the src from, in this case "app".

Community
  • 1
  • 1
ER.
  • 41
  • 2