Skip to content

Commit

Permalink
fix build to copy images when running preview
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed Dec 5, 2020
1 parent a1ba0b1 commit 8e015f2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gulp.d/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const postcssImport = require('postcss-import')
const postcssUrl = require('postcss-url')
const postcssVar = require('postcss-custom-properties')
const { Transform } = require('stream')
const map = (transform = (file, enc, next) => next()) => new Transform({ objectMode: true, transform })
const map = (transform) => new Transform({ objectMode: true, transform })
const through = () => map((file, enc, next) => next(null, file))
const uglify = require('gulp-uglify')
const vfs = require('vinyl-fs')

Expand Down Expand Up @@ -103,7 +104,7 @@ module.exports = (src, dest, preview) => () => {
.src('img/**/*.{gif,ico,jpg,png,svg}', opts)
.pipe(
preview
? map()
? through()
: imagemin(
[
imagemin.gifsicle(),
Expand Down

0 comments on commit 8e015f2

Please sign in to comment.