我有以下文件夹结构
这是我的gulpfile.js
的副本var gulp = require('gulp');
var jshint = require('gulp-jshint');
var jscs = require('gulp-jscs');
var jsFiles = ['*.js', 'src/**/*.js'];
gulp.task('style', function() {
return gulp.src(jsFiles)
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish', {
verbose: true
}))
.pipe(jscs());
});
gulp.task('inject', function() {
var wiredep = require('wiredep').stream;
var inject = require('gulp-inject');
var injectSrc = gulp.src(['./public/js/*.js', './public/css/*.css'], {read: false});
var injectOptions = {
ignorePath: '/public'
};
var options = {
bowerJson: require('./bower.json'),
directoy: './public/lib',
ignorePath: '../../public'
};
return gulp.src('./src/views/*.html')
.pipe(wiredep(options))
.pipe(inject(injectSrc, injectOptions))
.pipe(gulp.dest('./src/views'));
});
此文件中存在错误,因为css是注入的而不是js。
<!-- inject:css -->
<link rel="stylesheet" href="/css/styles.css">
<!-- endinject -->
<!-- inject.js -->
<!-- endinject -->
这是控制台显示的消息。哪个没有向我显示任何错误。