[gulp] gulp lint 忽略文件

how does the ignore parameter works in gulp and nodemon?

参考了 前端构建工具gulp入门教程,里面的lint我不需要检查所有js下面的文件,因为有的是插件的js,所以需要忽略掉,参考上面的方法,

答案翻译:

这个全局匹配你已经设置,node_modeules/* 只匹配这个文件在 node_modules 的根目录下,但不是所有的子文件夹都比较深。你需要设置 "node_moduels/**/*"代替,这将会匹配所有。我建议你仍然只匹配 js 文件在 node_moduels/**/js.

你同时需要用!号否定,gulp 不清楚你需要做的事情,那么它将会像"

1 gulp.src(['**/*.js', '!node_modules/**/*.js'])

相对 nodemon,下面也是一样的,你可以用 node_modules/**/* 匹配.

如有翻译错误,还请指正!

原文地址:https://www.cnblogs.com/fsong/p/5329854.html