Skip to content

Commit e5fdebb

Browse files
Merge pull request #3615 from Jolg42/fix-encoding
fix images encoding in dist zip
2 parents fc03274 + 1298e33 commit e5fdebb

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.changeset/stale-falcons-grin.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@jspsych/config": patch
3+
---
4+
5+
fix images encoding in dist zip

packages/config/gulp.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ export const createCoreDistArchive = () =>
8686
src("packages/plugin-survey/css/survey.css").pipe(rename("/dist/survey.css")),
8787
src("packages/plugin-survey/css/survey.min.css").pipe(rename("/dist/survey.min.css")),
8888

89-
// Examples
90-
src("examples/**/*", { base: "." })
89+
// Examples HTML files
90+
src(["examples/**/*.html"], { base: "." })
9191
// Rewrite script source paths
9292
.pipe(
9393
replace(
@@ -103,6 +103,12 @@ export const createCoreDistArchive = () =>
103103
)
104104
),
105105

106+
// Examples files other than HTML (e.g. media files)
107+
// Note: `encoding: false` means that the files contents are treated as binary.
108+
// This prevents Gulp from corrupting binary files such as images when it reads them.
109+
// Needed since Gulp v5.
110+
src(["examples/**/*", "!examples/**/*.html"], { base: ".", encoding: false }),
111+
106112
// VERSION.md
107113
file("VERSION.md", getVersionFileContents(), { src: true }),
108114

0 commit comments

Comments
 (0)