From 26cb12b20dd1cfe3e4d319a822f5dc6b1a58982b Mon Sep 17 00:00:00 2001
From: blavenie <benoit.lavenier@e-is.pro>
Date: Thu, 6 Aug 2020 17:15:24 +0200
Subject: [PATCH] [fix] Skip js vendor deletion, when running 'gulp
 webExtBuild' without the --release option

---
 gulpfile.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gulpfile.js b/gulpfile.js
index 0a557d29d..cf5ab46e9 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -637,12 +637,12 @@ function webCleanUnusedDirectories() {
 
   let patterns = [
     wwwPath + '/templates',
-    wwwPath + '/js',
     wwwPath + '/plugins'
   ];
 
   if (enableUglify) {
     patterns = patterns.concat([
+      wwwPath + '/js',
       wwwPath + '/css',
       wwwPath + '/dist',
       wwwPath + '/lib/*',
@@ -659,12 +659,14 @@ function webCleanUnusedDirectories() {
   }
   else {
     patterns = patterns.concat([
+      wwwPath + '/js/*',
+      '!' + wwwPath + '/js/vendor',
       wwwPath + '/dist_css',
       wwwPath + '/dist_js'
     ]);
   }
 
-  return gulp.src(patterns, {read: false})
+  return gulp.src(patterns, {read: false, allowEmpty: true})
     //.pipe(debug({title: 'deleting '}))
     .pipe(clean());
 }
-- 
GitLab