You could try using this to exclude these files in Gulp
gulp.task("CI-Prepare-Package-Files, function (callback) { var excludeList = [ config.websiteRoot + "\bin\{Sitecore,Lucene,Newtonsoft,System,Microsoft.Web.Infrastructure}*dll", config.websiteRoot + "\compilerconfig.json.defaults", config.websiteRoot + "\packages.config", config.websiteRoot + "\App_Config\Include\{Feature,Foundation,Project}\*Serialization.config", config.websiteRoot + "\App_Config\Include\{Feature,Foundation,Project}\z.DevSettings.config", "!" + config.websiteRoot + "\bin\Sitecore.Supportdll", "!" + config.websiteRoot + "\bin\Sitecore.{Feature,Foundation,Habitat,Demo,Common}*dll" ]; console.log(excludeList);
gulp.task("CI-Prepare-Package-Files, function (callback) {
var excludeList = [
config.websiteRoot + "\\bin\\{Sitecore,Lucene,Newtonsoft,System,Microsoft.Web.Infrastructure}*dll",
config.websiteRoot + "\\compilerconfig.json.defaults",
config.websiteRoot + "\\packages.config",
config.websiteRoot + "\\App_Config\\Include\\{Feature,Foundation,Project}\\*Serialization.config",
config.websiteRoot + "\\App_Config\\Include\\{Feature,Foundation,Project}\\z.*DevSettings.config",
"!" + config.websiteRoot + "\\bin\\Sitecore.Support*dll",
"!" + config.websiteRoot + "\\bin\\Sitecore.{Feature,Foundation,Habitat,Demo,Common}*dll"
];
console.log(excludeList);
return gulp.src(excludeList, { read: false }).pipe(rimraf({ force: true }));
});
});