我对Gulp不太熟悉,但需要将它用于项目。我的文件夹结构是这样的
- project
-- src
--- sass
---- css
----- ..many .sass files here
----- partials
------ ...many .sass files here
-- www
--- css
----- ....css files should go here (working)
------ partials
------- ...subfolder files should go here (not working)
我的尝试看起来像这样
var config = {
sass: {
src: [
'./src/sass/css/**/**.scss', './src/sass/css/partials/**/**.scss
],
paths: [
'./src/scss'
]
},
}
gulp.task('sass', function () {
return gulp.src(config.sass.src).pipe(sass({
paths: config.sass.paths.map(function(p){
return path.resolve(__dirname, p);
})
}))
.pipe(gulp.dest(path.join(config.dest, 'css')));
});
这样做的正确方法是什么?我是否需要将sass任务分开,因为目标目录不同?任何帮助将不胜感激!