Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
fs.readFile(file.path, 'UTF-8').then((contents) => {
file.contents = Buffer.from(contents)
next(null, file)
})
}
})
)
.pipe(buffer())
.pipe(uglify()),
vfs.src('css/site.css', { ...opts, sourcemaps }).pipe(postcss(postcssPlugins)),
vfs.src('font/*.{ttf,woff*(2)}', opts),
vfs
.src('img/**/*.{gif,ico,jpg,png,svg}', opts)
.pipe(
imagemin([
imagemin.gifsicle() || imagemin.noop,
imagemin.jpegtran() || imagemin.noop,
imagemin.optipng() || imagemin.noop,
imagemin.svgo({ plugins: [{ removeViewBox: false }] }),
])
),
vfs.src('helpers/*.js', opts),
vfs.src('layouts/*.hbs', opts),
vfs.src('partials/*.hbs', opts)
).pipe(vfs.dest(dest, { sourcemaps: sourcemaps && '.' }))
}