Gulp.js event stream merge order

前端 未结 4 1817
渐次进展
渐次进展 2021-01-31 09:20

I am trying to merge css and scss files into a main.css file that goes in my build directory. Its working, but not in the right order. The style attributes from the scss files n

4条回答
  •  爱一瞬间的悲伤
    2021-01-31 09:52

    Try streamqueue.

    var streamqueue = require('streamqueue');
    
    gulp.task('css', function () {
        return streamqueue({ objectMode: true },
                gulp.src(['dev/css/reset.css', 'dev/css/style.css', 'dev/css/typography.css', 'dev/css/sizes.css']),
                gulp.src(['dev/css/*.scss']).pipe(sass())
            )
            .pipe(concat('main.css'))
            .pipe(minifyCSS())
            .pipe(gulp.dest('build/css'))
    });
    

    This cheatsheet will help you. PDF is here.

提交回复
热议问题