0

I've been reading up on Gulp. In the following code you'll notice that in the gulp.src and the gulp.dest that the path starts with ./

gulp.src('./scss/*.scss')
  .pipe(sass({
    includePaths: ['bower_components/foundation/scss']
  }))
  .pipe(gulp.dest('./css'));

What is the purpose of the ./? Would the code run any differently without the dot?

danday74
  • 52,471
  • 49
  • 232
  • 283
JeremyE
  • 1,368
  • 4
  • 20
  • 40
  • 1
    `./` means current directory. To be more specified, the folder where the working file is in – niba Feb 17 '15 at 08:23

1 Answers1

2

Like @niba said, this script prefix its paths with ./ only to precise the current working directory.

It's a little fancy since you're not supposed to launch a gulp task at another place than in the directory containing your gulpfile, and even if called in a child directory, it will change the path to the one of your gulpfile.

Note that it does not work the same way as when you're using it with require, since it's the path of the directory in which it was required that is used.

Preview
  • 35,317
  • 10
  • 92
  • 112