我在gulp任务上加载了app.css。
效果很好,但现在我要添加“真棒字体”。
var appCSS = 'app.css';
gulp.task('css', ['less'], function() {
return gulp.src('app/**/*.css')
.pipe(concat(appCSS))
.pipe(gulp.dest(destination+'/css'))
.pipe(rename({suffix: '.min'}))
.pipe(cleanCSS())
.pipe(gulp.dest(destination+'/css'));
});
这是我以前的代码。现在我添加了这个波纹管...
var faCSS = 'fa.css';
var v4Shims = 'v4-shims.css';
gulp.task('fa', function() {
return gulp.src('app/**/*.css')
.pipe(concat(faCSS))
.pipe(gulp.dest(destination+'/css'))
.pipe(rename({suffix: '.min'}))
.pipe(cleanCSS())
.pipe(gulp.dest(destination+'/css'));
});
gulp.task('v4Shims', function() {
return gulp.src('app/**/*.css')
.pipe(concat(v4Shims))
.pipe(gulp.dest(destination+'/css'))
.pipe(rename({suffix: '.min'}))
.pipe(cleanCSS())
.pipe(gulp.dest(destination+'/css'));
});
但是它不起作用。我该怎么办?
答案 0 :(得分:0)
您的任务应该像您第一次一样工作。只需向第二个.css文件添加路径。让我们描述一下过程:
gulp.task('css', ['less'], function() {
return gulp.src('app/**/*.css') // here you are getting all files to be processed, then fonts should be here and has .css type format
.pipe(concat(appCSS)) // here you create output file, where all css would be combined all together
...
});