Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fonts are corrupting #123

Open
bilalmalkoc opened this issue Aug 16, 2024 · 3 comments
Open

Fonts are corrupting #123

bilalmalkoc opened this issue Aug 16, 2024 · 3 comments

Comments

@bilalmalkoc
Copy link

When bundle my app with gulp-zip, fonts getting corrupted. I am fixing this by uploading fonts as manually.

Here is my gulpfile.mjs

import rename from 'gulp-rename'
import gulp from 'gulp'
import gulpZip from 'gulp-zip'
import { homedir } from 'os'

const userHomeDirectory = homedir()
const desktopDir = `${userHomeDirectory}/Desktop`

const pluginFolder = 'production'

export const zip = () => {
  return gulp
    .src(
      [
        '**/*',
        '!node_modules/**',
        '!src/**',
        '!.browserslistrc',
        '!.eslintrc',
        '!eslint.config.mjs',
        '!.prettierrc',
        '!.stylelintrc.json',
        '!gulpfile.js',
        '!gulpfile.mjs',
        '!postcss.config.js',
        '!phpcs.xml.dist',
        '!package.json',
        '!composer.json',
        '!composer.lock',
        '!package-lock.json',
        '!webpack.config.js',
        '!.DS_Store',
        '!README.md',
        '!.idea/**',
        '!.github/**',
        '!.git/**',
        '!**/*.css.map',
        '!**/*.js.map',
      ],
    )
    .pipe(
      rename(function (path) {
        path.dirname = `${pluginFolder}/${path.dirname}`
      })
    )
    .pipe(gulpZip(`${pluginFolder}.zip`, { compress: true }))
    .pipe(gulp.dest(desktopDir))
}

Also tried compress: false. Still same problem.

@brokeboiflex
Copy link

Images are corrupted also

@j-oliveras
Copy link

I had the same issue with binary files.

I think this is caused by Gulp 5 breaking change "Default stream encoding to UTF-8". I solved it adding encoding: false on gulp.src options (second parameter).

@brokeboiflex
Copy link

I had the same issue with binary files.

I think this is caused by Gulp 5 breaking change "Default stream encoding to UTF-8". I solved it adding encoding: false on gulp.src options (second parameter).

Fixes the issue for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants