Ошибка с gulp-ruby-sass Ошибка: необходимо указать шаблон
Я использую Ruby Sass с PostCSS. Это моя задница.
gulp.task('css', function () {
var processors = [
short,
rucksack,
postcssmodules
];
return gulp.src('./css/src/*.scss')
.pipe(postcss(processors, {syntax: scss}))
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./dest'));
});
Я получаю ошибку
➜ website git:(master) ✗ gulp css
[09:52:08] Using gulpfile ~/my-projects/website/gulpfile.js
[09:52:08] Starting 'css'...
[09:52:08] 'css' errored after 12 ms
[09:52:08] Error: must provide pattern
at new GlobSync (/Users/jitendravyas/my-projects/website/node_modules/glob/sync.js:29:11)
at Function.globSync [as sync] (/Users/jitendravyas/my-projects/website/node_modules/glob/sync.js:24:10)
at /Users/jitendravyas/my-projects/website/node_modules/gulp-ruby-sass/index.js:68:21
at Array.forEach (native)
at gulpRubySass (/Users/jitendravyas/my-projects/website/node_modules/gulp-ruby-sass/index.js:67:10)
at /Users/jitendravyas/my-projects/website/gulpfile.js:48:15
at taskWrapper (/Users/jitendravyas/my-projects/website/node_modules/undertaker/lib/set-task.js:13:15)
at bound (domain.js:287:14)
at runBound (domain.js:300:12)
at asyncRunner (/Users/jitendravyas/my-projects/website/node_modules/async-done/index.js:36:18)
1 ответ
Вы не можете использовать gulp-ruby-sass
в .pipe()
, Прочитайте документы:
Используйте gulp-ruby-sass вместо
gulp.src
скомпилировать файлы Sass.
Вам придется использовать sass()
до вашего postcss()
:
gulp.task('css', function() {
var processors = [
short,
rucksack,
postcssmodules
];
return sass('./css/src/*.scss')
.on('error', sass.logError)
.pipe(postcss(processors))
.pipe(gulp.dest('./dest'));
});