Gulp`build`未按预期工作,仅将`index.html`作为输出

Gulp`build`未按预期工作,仅将`index.html`作为输出,gulp,gulp-uglify,gulp-useref,Gulp,Gulp Uglify,Gulp Useref,我正在使用gulp打包我的应用程序。但是我只得到index.html作为输出 我无法看到index.html文件中添加了所有css文件的vendar.js、app.js文件 我的期望是: 从index.htmlhref和src获取所有文件。从那个里,按照序列压缩索引文件中的内容并发送到dest文件夹 这是我的密码: var gulp = require("gulp"); var ghtmlSrc = require('gulp-html-src'); var templateCache = re

我正在使用
gulp
打包我的应用程序。但是我只得到
index.html
作为输出

我无法看到
index.html
文件中添加了所有
css
文件的
vendar.js、app.js
文件

我的期望是:

index.html
href和src获取所有文件。从那个里,按照序列压缩索引文件中的内容并发送到dest文件夹

这是我的密码:

var gulp = require("gulp");
var ghtmlSrc = require('gulp-html-src');
var templateCache = require("gulp-angular-templatecache");
var gulpif = require('gulp-if');
var ngAnnotate = require('gulp-ng-annotate');
var minifyCss = require('gulp-minify-css');
var useref = require('gulp-useref');
var uglify = require('gulp-uglify');

gulp.task('templates', function() {
    return gulp.src('./WebContent/src/**/*.html')
    .pipe(templateCache({
        root:'src/',
        module: 'newPCSApp.templates',
        standalone: true
    }))
    .pipe(gulp.dest('WebContent/src/app/'));
});

gulp.task('compress', function() {
            return gulp.src('./WebContent/index.html')
            .pipe(useref())
            .pipe(gulpif('*.js', ngAnnotate()))
            .pipe(gulpif('*.js', uglify({ mangle: false })))
            .pipe(gulpif('*.css', minifyCss()))
            .pipe(gulp.dest('./dist'));
        });


gulp.task('build',['templates', 'compress' ]);

在我将注释行添加到html文件后,问题得到了解决