S
S
Sergey Goryachev2016-04-02 01:10:43
JavaScript
Sergey Goryachev, 2016-04-02 01:10:43

Is it possible to use variables in gulpfile.js?

I want to set the name of the template, for example: $mytemplate
And then I need to substitute this value in the tasks.

gulp.task('sass', function(){
  return gulp.src('templates/$mytemplate/asset/sass/*.scss')
    .pipe(sass())
    .pipe(gulp.dest('templates/$mytemplate/css/'))
    .pipe(browserSync.stream());
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergeyj, 2016-04-02
@webirus

You can, because it's just regular JS.
You are apparently a beginner PHP developer, I am deriving it from single quotes and a variable in a string.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question