gpt4 book ai didi

javascript - gulp undefined 不是函数

转载 作者:行者123 更新时间:2023-12-01 11:53:43 24 4
gpt4 key购买 nike

我是 node、angular、gulp 的新手。我在运行 gulp 任务时使用 gulp 生成所有文件的缩小文件,它给我错误

enter image description here

下面是我的 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)

});

最佳答案

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

var gulp = require('gulp')

您可能还需要为您的项目安装 gulp,您可以使用 npm install --save gulp 来完成。

如果您没有 npm,我建议您研究一下如何安装和使用它。

关于javascript - gulp undefined 不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31634303/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com