使用Vinyl.src时,如何正确排除具有glob模式的文件?

问题描述

在使用node_modules vinyl-fs函数时,我一直试图忽略src,但是我的忽略模式都不起作用。

给出以下代码

import vfs from 'vinyl-fs';
import through from 'through2';

const globs = [`${folder}/**`,'!**/node_modules/**','!**/node_modules'];
vfs.src(globs)
.pipe(through.obj((file,encoding,callback) => {
    console.log(file.path);
    callback();
}));

当我记录文件路径时,尽管应该排除它们,但在node_modules文件夹中还是有很多文件。我尝试了各种node_modules排除模式,但没有一个起作用。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)