Gulp加载插件错误dep不是defiend [英] Gulp load plugins error dep is not defiend
本文介绍了Gulp加载插件错误dep不是defiend的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试使用gulp-load-plugins,但出现错误。例如,我尝试以下操作:
var istanbul = require('gulp-istanbul');
var $ = require('gulp-load-plugins')({lazy:true});
gulp.task('run',function(){
return gulp.src(config.files)
.pipe($。istanbul(
{
instrumenter:isparta.Instrumenter
}
))
.pipe(istanbul.hookRequire());
});
当我删除var istanbul = require('gulp-istanbul');我收到错误
ReferenceError:istanbul未定义
devDependencies:{
chai:3.5.0,
gulp:^ 3.9.1,
gulp-copy:0.0.2,
gulp -exec:^ 2.1.2,
gulp-istanbul:^ 1.0.0,
gulp-load-plugins:^ 1.2.4,
gulp-util:^ 3.0.7,
istanbul:0.4.4,
mocha:2.2.5,
...
}
任何想法我在这里错过了什么?
<您需要使用
$。istanbul
<$> p $ p>
.pipe($。istanbul.hookRequire())
I try to use gulp-load-plugins but I got error .
for example I try the following
var istanbul = require('gulp-istanbul');
var $ = require('gulp-load-plugins')({lazy: true});
gulp.task('run', function () {
return gulp.src(config.files)
.pipe($.istanbul(
{
instrumenter: isparta.Instrumenter
}
))
.pipe(istanbul.hookRequire());
});
when I remove the var istanbul = require('gulp-istanbul'); I got error ReferenceError: istanbul is not defined
"devDependencies": {
"chai": "3.5.0",
"gulp": "^3.9.1",
"gulp-copy": "0.0.2",
"gulp-exec": "^2.1.2",
"gulp-istanbul": "^1.0.0",
"gulp-load-plugins": "^1.2.4",
"gulp-util": "^3.0.7",
"istanbul": "0.4.4",
"mocha": "2.2.5",
...
}
Any idea what am I missing here?
解决方案
You need to use $.istanbul
.pipe($.istanbul.hookRequire())
这篇关于Gulp加载插件错误dep不是defiend的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文