7
我試圖編譯sass
使用gulp-ruby-sass
但我得到TypeError: glob pattern string required
。TypeError:需要的模式字符串
這是我gulpfile.js
是什麼樣子:
var gulp = require('gulp'),
sass = require('gulp-ruby-sass');
var paths = {
sassSrcPath: ['Content/css/**/*.scss'],
sassDestPath: ['build/css/'],
sassImportsPath: ['Content/styleguide/']
};
// Styles Task
gulp.task('styles', function() {
gulp.src(paths.sassSrcPath)
.pipe(sass({
style: 'compressed',
loadPath: [paths.sassImportsPath]
}))
.pipe(gulp.dest(paths.sassDestPath));
});
// Watch Task
gulp.task('watch', function() {
gulp.watch(paths.sassSrcPath, ['styles']);
});
gulp.task('default', ['styles', 'watch']);
這裏是我的文件夾結構:
├── Content
│ ├── css
│ │ ├── partials
│ │ │ └─_icons.scss
│ │ ├── main.css.scss
│ │ └── styleguide.css.scss
│ └── styleguide
│ ├── css
│ │ └─ vendor
│ │ └─ // Bunch of other folders that contain .sass files
│ └── // Other .sass files
└── gulpfile.js
我全新吞掉,我沒有使用任何步兵所以原諒我如果我犯了一個微不足道的錯誤。
甚至直接運行後,上海社會科學院,這也sassDestPath:['build/css /']生成錯誤「錯誤:無效的輸出文件夾」,所以我將其更改爲'build/css /',這就解決了問題 –