Forráskód Böngészése

updated gulpfiles to gulp4

Bachir Soussi Chiadmi 5 éve
szülő
commit
80b19b1a81

+ 6 - 0
web/modules/custom/.browserlistrc

@@ -0,0 +1,6 @@
+# Browsers that we support
+
+last 2 version
+> 1%
+maintained node versions
+not dead

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
web/modules/custom/edlp_corpus/assets/dist/styles/corpus.min.css


+ 29 - 26
web/modules/custom/gulpfile.js

@@ -33,38 +33,41 @@ function handleError(err) {
   console.log(err.toString());
 }
 
-gulp.task('scripts', function () {
-  var tasks = modules.map(function(module) {
-    return gulp.src('./'+module+'/assets/scripts/*.js')
-      .pipe(gulpif(prod, stripDebug()))
-      .pipe(gulpif(prod, jsmin()))
-      .pipe(rename({suffix: '.min'}))
-      .pipe(gulp.dest('./'+module+'/assets/dist/scripts/'));
+gulp.task('scripts', function (done) {
+  return new Promise(function(resolve, reject) {
+    modules.map(function(module) {
+      gulp.src('./'+module+'/assets/scripts/*.js')
+        .pipe(gulpif(prod, stripDebug()))
+        .pipe(gulpif(prod, jsmin()))
+        .pipe(rename({suffix: '.min'}))
+        .pipe(gulp.dest('./'+module+'/assets/dist/scripts/'));
+    });
+    resolve();
   });
-  return es.merge.apply(null, tasks);
 });
 
-gulp.task('styles', function () {
-  var tasks = modules.map(function(module) {
-    return gulp.src('./'+module+'/assets/styles/*.scss')
-      .pipe(sass().on('error', sass.logError))
-      .pipe(autoprefixer({
-          browsers: ['last 2 versions'],
-          cascade: false
-      })).on('error', handleError)
-      .pipe(gulpif(prod, cssmin()))
-      // .pipe(cssmin())
-      .pipe(rename({suffix: '.min'}))
-      .pipe(gulp.dest('./'+module+'/assets/dist/styles/'));
+gulp.task('styles', function (done) {
+  return new Promise(function(resolve, reject) {
+    modules.map(function(module) {
+      gulp.src('./'+module+'/assets/styles/*.scss')
+        .pipe(sass().on('error', sass.logError))
+        .pipe(autoprefixer({
+            cascade: false
+        })).on('error', handleError)
+        .pipe(gulpif(prod, cssmin()))
+        // .pipe(cssmin())
+        .pipe(rename({suffix: '.min'}))
+        .pipe(gulp.dest('./'+module+'/assets/dist/styles/'));
+    });
+    resolve();
   });
-  return es.merge.apply(null, tasks);
 });
 
 // default gulp task
-gulp.task('default', ['scripts', 'styles'], function() { //'bower',
+gulp.task('default', gulp.series('scripts', 'styles', done => {
   for (var i = 0; i < modules.length; i++) {
-    // gulp.watch('./assets/styles/*/*.scss', ['styles']);
-    gulp.watch('./'+modules[i]+'/assets/styles/*.scss', ['styles']);
-    gulp.watch('./'+modules[i]+'/assets/scripts/*.js', ['scripts']);
+    gulp.watch('./'+modules[i]+'/assets/styles/*.scss', gulp.series('styles'));
+    gulp.watch('./'+modules[i]+'/assets/scripts/*.js', gulp.series('scripts'));
   }
-});
+  done()
+}));

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 512 - 135
web/modules/custom/package-lock.json


+ 2 - 1
web/modules/custom/package.json

@@ -18,7 +18,8 @@
     "gulp-sass": "^4.0.1",
     "gulp-strip-debug": "^3.0.0",
     "gulp-watch": "latest",
-    "minimist": "^1.2.0"
+    "minimist": "^1.2.0",
+    "node-sass": "^4.12.0"
   },
   "dependencies": {}
 }

+ 32 - 26
web/themes/custom/edlptheme/gulpfile.js

@@ -28,16 +28,17 @@ function handleError(err) {
   console.log(err.toString());
 }
 
-gulp.task('scripts', function () {
+gulp.task('scripts', done => {
   gulp.src(['./assets/scripts/main.js', './assets/scripts/redirect.js']) // './assets/scripts/shared_variables.js',
     // .pipe(concat('main.js'))
     .pipe(gulpif(prod, stripDebug()))
     .pipe(gulpif(prod, jsmin()))
     .pipe(rename({suffix: '.min'}))
     .pipe(gulp.dest('./assets/dist/scripts/'));
+  done()
 });
 
-gulp.task('styles', function () {
+gulp.task('styles', done => {
   gulp.src(['./assets/styles/app.scss'])
     .pipe(sass().on('error', sass.logError))
     .pipe(autoprefixer({
@@ -49,44 +50,49 @@ gulp.task('styles', function () {
     // .pipe(cssmin())
     .pipe(rename({suffix: '.min'}))
     .pipe(gulp.dest('./assets/dist/styles/'));
+  done()
 });
 
-gulp.task('bower', function() {
-    gulp.src(mainBowerFiles({
-      "overrides":{
-        "masonry-layout":{
-          "main":"./dist/masonry.pkgd.min.js"
-        },
-        "imagesloaded":{
-          "main":"./imagesloaded.pkgd.min.js"
-        },
-        "jquery":{"ignore":true},
-        "ev-emitter":{"ignore":true},
-        "fizzy-ui-utils":{"ignore":true},
-        "get-size":{"ignore":true},
-        "outlayer":{"ignore":true},
-      }
-    }))
-      .pipe(gulp.dest('./assets/dist/bower/'));
+gulp.task('bower', done => {
+  gulp.src(mainBowerFiles({
+    "overrides":{
+      "masonry-layout":{
+        "main":"./dist/masonry.pkgd.min.js"
+      },
+      "imagesloaded":{
+        "main":"./imagesloaded.pkgd.min.js"
+      },
+      "jquery":{"ignore":true},
+      "ev-emitter":{"ignore":true},
+      "fizzy-ui-utils":{"ignore":true},
+      "get-size":{"ignore":true},
+      "outlayer":{"ignore":true},
+    }
+  }))
+    .pipe(gulp.dest('./assets/dist/bower/'));
+  done()
 });
 
-gulp.task('svg', function () {
+gulp.task('svg', done => {
   gulp.src(['./assets/img/*.svg', '!./assets/img/edlp-loader-anim.svg'])
     .pipe(svgmin())
     .pipe(gulp.dest('./assets/dist/img'));
   gulp.src('./assets/img/edlp-loader-anim.svg')
     .pipe(gulp.dest('./assets/dist/img'));
+  done()
 });
 
 // default gulp task
 // ,  'vars2sass' 'vars2js',
-gulp.task('default', ['bower', 'scripts', 'styles', 'svg'], function() {
+// gulp.task('default', ['bower', 'scripts', 'styles', 'svg'], function() {
+gulp.task('default', gulp.series('bower', 'scripts', 'styles', 'svg', function(done) {
   // gulp.watch('./assets/json/*.json', ['vars2js', 'styles', 'scripts']); //, 'vars2sass'
-  gulp.watch('./assets/styles/*.scss', ['styles']);
-  gulp.watch('./assets/styles/base/*.scss', ['styles']);
-  gulp.watch('./assets/scripts/*.js', ['scripts']);
-  gulp.watch('./assets/img/*.svg', ['svg']);
-});
+  gulp.watch('./assets/styles/*.scss', gulp.series('styles'));
+  gulp.watch('./assets/styles/base/*.scss', gulp.series('styles'));
+  gulp.watch('./assets/scripts/*.js', gulp.series('scripts'));
+  gulp.watch('./assets/img/*.svg', gulp.series('svg'));
+  done()
+}));
 
 
 

+ 5 - 4
web/themes/custom/edlptheme/package.json

@@ -7,7 +7,7 @@
   "license": "GPLv3",
   "homepage": "https://encyclopediedelaparole.org",
   "devDependencies": {
-    "gulp": "latest",
+    "gulp": "^4.0.2",
     "gulp-autoprefixer": "^5.0.0",
     "gulp-concat": "latest",
     "gulp-cssmin": "latest",
@@ -16,13 +16,14 @@
     "gulp-json-to-sass": "latest",
     "gulp-json2js": "latest",
     "gulp-rename": "latest",
-    "gulp-sass": "^4.0.1",
+    "gulp-sass": "^4.0.2",
     "gulp-strip-debug": "^3.0.0",
     "gulp-svgmin": "^1.2.4",
     "gulp-util": "latest",
     "gulp-watch": "latest",
-    "main-bower-files": "latest",
-    "minimist": "^1.2.0"
+    "main-bower-files": "^2.13.3",
+    "minimist": "^1.2.0",
+    "node-sass": "^4.12.0"
   },
   "dependencies": {}
 }

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott