Gulp.js 事件流合并顺序

Gulp.js event stream merge order(Gulp.js 事件流合并顺序)
本文介绍了Gulp.js 事件流合并顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!


我正在尝试将 css 和 scss 文件合并到我的构建目录中的 main.css 文件中.它的工作,但不是在正确的顺序.scss 文件中的样式属性需要位于 main.css 文件的底部,以便它们覆盖其余部分.

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 need to be in the bottom of the main.css file so they overrule the rest.

我的 Gulp 任务如下所示:

my Gulp task looks like this:

gulp.task('css', function () {
    var cssTomincss = gulp.src(['dev/css/reset.css', 'dev/css/style.css','dev/css/typography.css',    'dev/css/sizes.css']);

    var cssFromscss = gulp.src(['dev/css/*.scss'])

    return es.merge(cssTomincss, cssFromscss)

我首先用变量定义源.我正在使用 gulp-sass 插件将 scss 文件转换为普通 css (.pipe(sass)),然后使用 es.merge 函数将两者合并并将它们连接到 main.css.

I am defining the sources first with variables. I am using the gulp-sass plugin to convert the scss file into normal css (.pipe(sass)) and later merging the two with the es.merge function and concatenating them into main.css.

问题在于 .scss 文件的样式属性最终位于 main.css 文件的顶端某处.我需要他们在底部.所以它们需要在底部连接起来.

The problem is that the style attributes van the .scss files end up somewhere in the top end of the main.css file. I need them to be at the bottom. So they need to be concatenated at the bottom.


Any clue on how to do this?



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']),

这个备忘单会帮助你.PDF 在这里.

这篇关于Gulp.js 事件流合并顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!



How do I can get a text of all the cells of the table using testcafe(如何使用 testcafe 获取表格中所有单元格的文本)
node_modules is not recognized as an internal or external command(node_modules 未被识别为内部或外部命令)
How can I create conditional test cases using Protractor?(如何使用 Protractor 创建条件测试用例?)
PhantomJS and clicking a form button(PhantomJS 并单击表单按钮)
Clicking #39;OK#39; on alert or confirm dialog through jquery/javascript?(在警报上单击“确定或通过 jquery/javascript 确认对话框?)
QunitJS-Tests don#39;t start: PhantomJS timed out, possibly due to a missing QUnit start() call(QunitJS-Tests 不启动:PhantomJS 超时,可能是由于缺少 QUnit start() 调用)