Skip to content

Commit 6181177

Browse files
committed
drop through2 dependency
use native stream.Transform instead
1 parent 158beeb commit 6181177

File tree

6 files changed

+33
-208
lines changed

6 files changed

+33
-208
lines changed

gulp.d/lib/gulp-prettier-eslint.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
'use strict'
22

33
const log = require('fancy-log')
4-
const { obj: map } = require('through2')
54
const PluginError = require('plugin-error')
65
const prettierEslint = require('prettier-eslint')
6+
const { Transform } = require('stream')
7+
const map = (transform) => new Transform({ objectMode: true, transform })
78

89
module.exports = () => {
910
const report = { changed: 0, unchanged: 0 }

gulp.d/tasks/build-preview-pages.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ Error.call = (self, ...args) => {
99
const asciidoctor = require('asciidoctor.js')()
1010
const fs = require('fs-extra')
1111
const handlebars = require('handlebars')
12-
const { obj: map } = require('through2')
1312
const merge = require('merge-stream')
1413
const ospath = require('path')
1514
const path = ospath.posix
1615
const requireFromString = require('require-from-string')
16+
const { Transform } = require('stream')
17+
const map = (transform = () => {}, flush = undefined) => new Transform({ objectMode: true, transform, flush })
1718
const vfs = require('vinyl-fs')
1819
const yaml = require('js-yaml')
1920

@@ -62,7 +63,7 @@ module.exports = (src, previewSrc, previewDest, sink = () => map()) => (done) =>
6263
})
6364
)
6465
.pipe(vfs.dest(previewDest))
65-
.on('error', (e) => done)
66+
//.on('error', done)
6667
.pipe(sink())
6768
)
6869

gulp.d/tasks/build.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const concat = require('gulp-concat')
77
const cssnano = require('cssnano')
88
const fs = require('fs-extra')
99
const imagemin = require('gulp-imagemin')
10-
const { obj: map } = require('through2')
1110
const merge = require('merge-stream')
1211
const ospath = require('path')
1312
const path = ospath.posix
@@ -16,6 +15,8 @@ const postcssCalc = require('postcss-calc')
1615
const postcssImport = require('postcss-import')
1716
const postcssUrl = require('postcss-url')
1817
const postcssVar = require('postcss-custom-properties')
18+
const { Transform } = require('stream')
19+
const map = (transform) => new Transform({ objectMode: true, transform })
1920
const uglify = require('gulp-uglify')
2021
const vfs = require('vinyl-fs')
2122

gulp.d/tasks/remove.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
'use strict'
22

33
const fs = require('fs-extra')
4-
const { obj: map } = require('through2')
4+
const { Transform } = require('stream')
5+
const map = (transform) => new Transform({ objectMode: true, transform })
56
const vfs = require('vinyl-fs')
67

78
module.exports = (files) => () =>

0 commit comments

Comments
 (0)