3

在这里,我对节点、角度、gulp 很陌生。我在运行 gulp 任务时使用 gulp 生成所有东西的缩小文件,它给了我错误

在此处输入图像描述

下面是我的 gulpfile.js 代码

gulp.task('dev', function(){
var builtPartialDev = gulp.src(paths.partials)
    .pipe(plugins.htmlhint({'doctype-first':false}))
    .pipe(plugins.htmlhint.reporter())
    .pipe(gulp.dest(paths.distDev));

var buitStyleDev = gulp.src(paths.styles)
    .pipe(plugins.less())
    .pipe(gulp.dest(paths.distDev));

var builtAppScriptsDev = gulp.src(paths.scripts)
    .pipe(plugins.jshint())
    .pipe(plugins.jshint.reporter('jshint-stylish'))
    .pipe(gulp.dest(paths.distDev))
    .pipe(plugins.angularFilesort());

var builtVendorScriptsDev = gulp.src(bowerFiles())
    .pipe(gulp.dest(paths.distDevBowerComponents))
    .pipe(plugins.order(['jquery.js', 'angular.js', 'angular-ui.js', 'ui-bootstrap.js', 'ui-bootstrap-tpls.js']));


var builtIndexDev = gulp.src(paths.index)
    .pipe(plugins.htmlhint())
    .pipe(plugins.htmlhint.reporter())
    .pipe(gulp.dest(path.distDev))
    .pipe(plugins.inject(builtVendorScriptsDev, {relative:true, name:'bower'}))
    .pipe(plugins.inject(builtAppScriptsDev, {relative:true}))
    .pipe(plugins.inject(buitStyleDev, {relative:true}))
    .pipe(gulp.dest(paths.distDev));

return es.merge(builtIndexDev, builtPartialDev) 

});
4

1 回答 1

0

您需要在 gulpfile 中要求 gulp。将以下行添加到您的文件中:

var gulp = require('gulp')

您可能还必须为您的项目安装 gulp,您可以使用npm install --save gulp.

如果你没有 npm,我建议你看看如何安装和使用它。

于 2015-07-26T06:26:06.537 回答