msm*_*cic 9 gulp gulp-ruby-sass
我正在尝试编译sass,gulp-ruby-sass但我得到了TypeError: glob pattern string required.
这就是我的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']);
Run Code Online (Sandbox Code Playgroud)
这是我的文件夹结构:
??? 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
Run Code Online (Sandbox Code Playgroud)
我是Gulp的新手,我也没有使用过Grunt,如果我犯了一个小错误,请原谅我.
kom*_*cha 18
看一下这些文档,看起来你似乎不想进入gulp-ruby-sass,而是直接调用它:
gulp.task('styles', function () {
return sass(paths.sassSrcPath, {
style: 'compressed',
loadPath: [paths.sassImportsPath]
})
.pipe(gulp.dest(paths.sassDestPath));
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
15052 次 |
| 最近记录: |