0

I have this project in Symfony

src
  ProjectName
    AdminBundle
      Resources
        public
          css
            style1.css
            style2.ccs
        sass
          style1.scss
          style2.scss
    AdvertiserBundler
      ..
    CommonBundle
      ..
    PublicBundle
      ..
    WebmaserBundle
      ..

All bundles have the same structure. All *.scss files are in Resources/sass/ and compiled *.css files are in Resources/public/css/. How I can put all files from A to B with one function? I try work with base, but nothing happens.

This is gulpfile.js

var gulp = require('gulp'),
    sass = require('gulp-sass'),
    autoprefixer = require('gulp-autoprefixer'),
    minifycss = require('gulp-minify-css')
;

gulp.task('styles', function() {
    gulp.src('src/ProjectName/*Bundle/Resources/sass/*.scss', {
        base: 'sass'
    })
        .pipe(sass({
            outputStyle: 'compressed',
            errLogToConsole: true
        }))
        .pipe(autoprefixer('last 5 version', 'ie 9'))
        .pipe(minifycss())
        .pipe(gulp.dest('public/css/'))
    ;
});

gulp.task('default', ['styles'], function() {    
    gulp.watch('src/ProjectName/*Bundle/Resources/sass/*.scss', ['styles']);
});

I don't want write like this five times:

....
gulp.src('src/ProjectName/AdminBundle/Resources/sass/*.scss')
.pipe(gulp.dest('src/ProjectName/AdminBundle/Resources/public/css'))
....
Luntegg
  • 2,496
  • 3
  • 16
  • 31

1 Answers1

0

You can define multiple paths as follows: gulp.src(['path1', 'path2']). Source: Glob stream

JordyvD
  • 1,565
  • 1
  • 18
  • 45
  • How can I write this for compile css in gulp.dest? For `/public/css/`? – Luntegg Oct 02 '15 at 17:08
  • [This](http://stackoverflow.com/questions/26784094/can-i-use-a-gulp-task-with-multiple-sources-and-multiple-destinations) might be worth the read =) – JordyvD Oct 06 '15 at 07:27