简体   繁体   English

gulp在gulp-load-plugins中加载其他模式错误

[英]gulp loading other patterns in gulp-load-plugins error

I am loading gulp-load-plugins and other patterns, but when I use del package, it says it is undefined: 我正在加载gulp-load-plugins和其他模式,但是当我使用del软件包时,它说它是未定义的:

var $ = require('gulp-load-plugins')({
    pattern: ['gulp-*', 'gulp.*', '@*/gulp{-,.}*', 'main-bower-files', 'uglify-save-license', 'del']
});

here is how i use it: 这是我的用法:

gulp.task('clean', function ()
{
    return $.del([...]);
});

error i get: 我得到的错误:

 TypeError: $.del is not a function

In case if you haven't installed del package as your dependency, please install it using the below command, 如果您尚未安装del软件包作为依赖项,请使用以下命令进行安装,

npm install --save-dev del

And also as suggested by AHC ensure that you've included as part of your devDependencies in your package.json which you'll be referring through your gulp-load-plugins package. 并且还应按照AHC的建议,确保将您的devDependenciespackage.json ,这将通过devDependencies gulp-load-plugins包进行引用。

Hope this helps! 希望这可以帮助!

if it is already installed, then it is because you should include it in the devdependencies in the package.json file as well, for it to load with gulp-load-plugins 如果已安装,则是因为您也应该将其包含package.json文件的devdependencies中,以便使用gulp-load-plugins

  "devDependencies": {
    "del": "^2.0.2",
     ...
   }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM