Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix copying of binary files during asset build #8953

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ const fontFiles = 'h/static/styles/vendor/fonts/h.woff';

gulp.task('build-fonts', () => {
const fontsDir = 'build/fonts';
return gulp.src(fontFiles).pipe(changed(fontsDir)).pipe(gulp.dest(fontsDir));
return gulp
.src(fontFiles, { encoding: false })
.pipe(changed(fontsDir))
.pipe(gulp.dest(fontsDir));
});

gulp.task('watch-fonts', () => {
Expand Down Expand Up @@ -75,7 +78,11 @@ gulp.task('build-images', () => {

const imagesDir = 'build/images';
return gulp
.src(imageFiles)
.src(imageFiles, {
// Treat all files as binary. Some of the images are SVGs which are text,
// but `svgmin` is still able to process the files if passed as binary.
encoding: false,
})
.pipe(changed(imagesDir))
.pipe(gulpIf(shouldMinifySVG, svgmin(svgminConfig)))
.pipe(gulp.dest(imagesDir));
Expand Down
Loading