Skip to content

Commit 27bb374

Browse files
committed
solving vulnerable dependencies
gulp 4 compatibility
1 parent 2962f99 commit 27bb374

File tree

3 files changed

+5286
-6958
lines changed

3 files changed

+5286
-6958
lines changed

gulpfile.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11

22
const gulp = require("gulp");
33
const clean = require('gulp-clean');
4-
const runSequence = require('run-sequence');
4+
const runSequence = require('gulp4-run-sequence');
55
const rename = require("gulp-rename");
66
const through = require('through2');
77
const gulpif = require('gulp-if');
88
const lazypipe = require('lazypipe');
9-
const buffer = require("vinyl-buffer");
9+
const vinylString = require("vinyl-string");
1010
const source = require('vinyl-source-stream');
1111
const filter = require('gulp-filter');
1212
const debug = require('gulp-debug');
@@ -139,7 +139,7 @@ var WebPack = (function() {
139139
module: {
140140
loaders: [{
141141
test: /\.css$/,
142-
loader: __dirname+"/node_modules/style-loader!"+__dirname+"/node_modules/css-loader?importLoaders=1"
142+
loader: __dirname+"/node_modules/style-loader!"+__dirname+"/node_modules/css-loader?importLoaders=true"
143143
},{
144144
test: /\.(png|woff|woff2|eot|ttf|svg)$/,
145145
loaders: [__dirname+"/node_modules/url-loader?limit=100000"]
@@ -308,10 +308,9 @@ gulp.task("make-i86n-keys",function(callback) {
308308
});
309309
Promise.all(promises)
310310
.then(()=>{
311-
var stream = source('weh-i18n-keys.js');
312-
stream.end('module.exports = ' + stringify(keys,{ space: ' ' }));
313-
stream
314-
.pipe(buffer())
311+
vinylString('module.exports = ' + stringify(keys,{ space: ' ' }),{
312+
path: 'weh-i18n-keys.js'
313+
})
315314
.pipe(gulp.dest(buildTmpModDir))
316315
.on('end',callback);
317316
})
@@ -361,22 +360,23 @@ gulp.task("watch-src",function(callback) {
361360
);
362361
});
363362

364-
gulp.task("watch", function() {
365-
gulp.watch([srcDir+"/**/*",srcModDir+"/**/*","src/**/*",__dirname+"/src/**/*"],["watch-src"]);
366-
gulp.watch(locDir+"/**/*",["watch-locales"]);
363+
gulp.task("watch", function(callback) {
364+
gulp.watch([srcDir+"/**/*",srcModDir+"/**/*","src/**/*",__dirname+"/src/**/*"],gulp.series("watch-src"));
365+
gulp.watch(locDir+"/**/*",gulp.series("watch-locales"));
366+
callback();
367367
});
368368

369369
// list available templates
370-
gulp.task("templates",function() {
370+
gulp.task("templates",function(callback) {
371371
var templates = fs.readdirSync(path.join(__dirname,"templates"));
372372
templates.forEach(function(template) {
373373
var manifest = null;
374374
try {
375375
manifest = JSON.parse(fs.readFileSync(path.join(__dirname,"templates",template,"src/manifest.json"),"utf8"));
376376
} catch(e) {}
377377
console.info(template+":",manifest && manifest.description ? manifest.description : "no description found");
378-
});
379-
process.exit(0);
378+
});
379+
callback();
380380
});
381381

382382
gulp.task("default", function(callback) {
@@ -416,7 +416,7 @@ gulp.task("init", function(callback) {
416416
});
417417

418418
// get some help
419-
gulp.task("help", function() {
419+
gulp.task("help", function(callback) {
420420
var help = [
421421
"weh version "+package.version,
422422
"usage: gulp [<commands>] [<options>]",
@@ -444,8 +444,8 @@ gulp.task("help", function() {
444444
" --ejsdata <name=value>: define variable to be used in EJS preprocessing",
445445
" --force-build-date <date>: force build date"
446446
];
447-
console.log(help.join("\n"));
448-
process.exit(0);
447+
console.log(help.join("\n"));
448+
callback();
449449
});
450450

451451
// copy template directory when creating new project

0 commit comments

Comments
 (0)