0

I am able to compile my SCSS to CSS with given destination. However not only I want the file to be compiled to CSS but would like the containing folder to be also copied to the destination. By giving folder to look at it should pick up each sub directory with scss file and output to destination.

 - Project
    -SCSS
      -Home
        -Style.scss
       -About
        -about.scss

     -Dest
      -Home //add directory path
        -Style.css
      -About
        -about.css

My Gulp

gulp.task('build-css', function() {
   return gulp.src(['./Project/SCSS/**/*.scss'])
        .pipe(sass({
            outputStyle: 'compressed'
        }).on('error', sass.logError))
        .pipe(prefix())
        .pipe(gulp.dest('Content/Shared/Styles'))
        .pipe(livereload());
});
hello world
  • 385
  • 5
  • 24
  • Why not just make the destination Des/Home? Can you post your gulpfile? – Alexander Nied Feb 24 '17 at 19:54
  • I want to be dynamic without having to hard code the directory name so basically the more folders I have in the scss folder it should automatically pick the folder and place to destination – hello world Feb 24 '17 at 19:59
  • Possibly relevant links: [link1](http://stackoverflow.com/questions/25038014/how-do-i-copy-directories-recursively-with-gulp) [link2](http://stackoverflow.com/questions/22240977/gulp-js-use-path-from-gulp-src-in-gulp-dest) – Alexander Nied Feb 24 '17 at 20:02
  • Have you tried providing 'base' in your src ? ```gulp.src(['./Project/SCSS/**/*.scss'], {base: './'})``` – Supra Jul 19 '17 at 12:35

0 Answers0