为什么我的gulp src忽略了用“排除”&引用;
我的吞咽脚本忽略了我在src中的not排除为什么我的gulp src忽略了用“排除”&引用;,gulp,Gulp,我的吞咽脚本忽略了我在src中的not排除 gulp.src([ srcPath + name + '/.env', srcPath + name + '/**/bin/*', '!' + srcPath + name + '/dist', srcPath + name + '/node_modules', srcPath + name + '/**/*.js', '!' + srcPath + name + '/config' ]) 但是它仍然包含srcPa
gulp.src([
srcPath + name + '/.env',
srcPath + name + '/**/bin/*',
'!' + srcPath + name + '/dist',
srcPath + name + '/node_modules',
srcPath + name + '/**/*.js',
'!' + srcPath + name + '/config'
])
但是它仍然包含srcPath+name+'/dist'文件,尽管我知道用!排除文件。放入
代码>最后,它会起作用(这是我见过的最违反直觉的事情之一)。我假设srcPath
和name
是正确的
gulp.src([
srcPath + name + '/.env',
srcPath + name + '/**/bin/*',
srcPath + name + '/node_modules',
srcPath + name + '/**/*.js',
'!' + srcPath + name + '/dist',
'!' + srcPath + name + '/config'
])
嗯,即使进行了更改,它仍然在/dist文件夹上复制,因为我正在将src管道传输到.pipe(gulp.dest(srcPath+name+'/dist/'))
。。。因此,它在目标dist内创建一个递归dist文件夹,例如dist/dist。。我认为*/.js优先