GULP SASS需要多条路径 [英] GULP SASS requiring multiple paths

查看:152
本文介绍了GULP SASS需要多条路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用gulp-sass包含多个所需的路径。它可以正常工作,只需要一个路径:

  .pipe(sass({
includePaths:require('node- ('error',sass.logError))
outputStyle:'compressed'
})。 $ p>

我已经尝试在数组中传递这些路径。但它并不起作用。

  var neat = require('node-neat')。includePaths,
normalize = require('node-normalize-scss')。includePaths;

.pipe(sass({
includePaths:[
normalize,
neat
],
outputStyle:'compressed'$ b $ ('error',sass.logError))


解决方案

由于 includePaths 属性可以返回数组,因此请尝试以下语法:

 < code $ sa $ {
includePaths:[] .concat(normalize,neat),
outputStyle:'compressed'
})


how can i include multiple required paths using gulp-sass. it works fine with just one path like:

   .pipe(sass({
        includePaths: require('node-normalize-scss').includePaths,
        outputStyle: 'compressed'
    }).on('error', sass.logError))

i’ve already tried passing those paths in an array. but it doesn't work neither.

    var neat = require('node-neat').includePaths,
        normalize = require('node-normalize-scss').includePaths;

   .pipe(sass({
        includePaths: [
              normalize,
              neat
        ],
        outputStyle: 'compressed'
    }).on('error', sass.logError))

解决方案

As the includePaths property could return an array, try the following syntax :

sass({
    includePaths: [].concat(normalize, neat),
    outputStyle: 'compressed'
})

这篇关于GULP SASS需要多条路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆