How to rename a compiled sass file to a Gulp task

I am trying to write a simple gulp task that takes a scss file named manifest.scss and after compiling and minifying the file, it saves the result to the destination folder as app.css

The next task does almost everything I want by renaming the file (output is build / css / manifest.css)

gulp.task('sass', function() {
 gulp.src("src/sass/manifest.scss")
      .pipe(sass({ style: 'compressed' }))
      .pipe(minifyCSS())
      .pipe(gulp.dest('build/css'));
});

      

So, I tried gulp-rename and I updated the task like this:

gulp.task('sass',  function() {
 gulp.src("src/sass/manifest.scss")
      .pipe(sass({ style: 'compressed' }))
      .pipe(minifyCSS())
      .pipe(rename('app.css'))
      .pipe(gulp.dest('build/css'));
});

      

This creates a build / css / app.css file, but it is completely empty.

How do I rename a compiled file?

thank

+3
gulp


source to share


No one has answered this question yet

Check out similar questions:

1203
NPM vs. Bower vs. Browserify vs. Gulp vs. Grunt vs. Webpack
48
gulp minify all css files into one file
7
gulp-sass don't compile sass files
7
How do I combine gulp-watch and gulp-injection?
3
Gulp-ruby-sass Error:
3
You need to run gulp multiple times to get style changes
2
-webkit-box-orient: vertical; in sass does not compile in gulp
2
Gulp-sass will not compile scss files to css, but copy all files from scss folder to css folder
1
Gulp compiles SCSS / SASS into separate files
0
Gulp, Sass processing - stops at 1 file



All Articles
Loading...
X
Show
Funny
Dev
Pics