question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

gulp.dest - specific .css file for output instead of directory

See original GitHub issue

Just noticed this while trying to integrate Gulp into a WordPress theme I’m building. Can’t output my .scss into the required style.css file in the theme’s root. Not sure if I’m missing something, but this kind of functionality seems necessary.

Ex:

gulp.task('sass', function() {
  gulp.src('./scss/*.scss')
      .pipe(sass())
      .pipe(gulp.dest('style.css'));
});

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

26reactions
cmegowncommented, Jan 28, 2014

Ok finally got a chance to look at this. You are, of course, correct. Here’s what I ended up with in case anyone else comes across this looking for the same thing:

gulp.task('sass', function() {
  gulp.src('./scss/*.scss')
      .pipe(sass())
      .pipe(concat('style.css')) // this is what was missing
      .pipe(gulp.dest('./')); // output to theme root
});

Thanks for your help @dlmanning!

3reactions
dlmanningcommented, Jan 27, 2014

You want to pipe the result of gulp-sass into gulp-concat to concatenate them together into a single file.

Read more comments on GitHub >

github_iconTop Results From Across the Web

gulp.dest to be same as the current file? - Stack Overflow
I'm trying to pipe my compiled .css file to same directory as its original .scss one
Read more >
Page Specific CSS - SymfonyCasts
Here's the goal: configure Gulp to give us two files: main.css made from styles.scss and layout.scss and dinosaur.css made from this new one....
Read more >
Compiling less file with Gulp - Webkul Blog
What actually happen is we have to compile less file into css . ... consist of your style.css file whereas src directory consist...
Read more >
Setting up a CSS build process with Gulp - Medium
We are going to implement a CSS build process that will compile ... is the path of the specific file to read;; gulp.dest():...
Read more >
Simplify Front-end JS and CSS Optimization With Gulp - Toptal
The gulpfile.js file is where we will define the tasks that Gulp will perform for us. The package.json is used by npm to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found