Skip to content

Instantly share code, notes, and snippets.

@salarmehr
Created September 23, 2017 08:52
Show Gist options
  • Save salarmehr/07ce72c11feddade7e02367a605b6b33 to your computer and use it in GitHub Desktop.
Save salarmehr/07ce72c11feddade7e02367a605b6b33 to your computer and use it in GitHub Desktop.
Making vendor folder smaller for product deployment.
gulp.task('zip-vendor', function () {
return gulp.src(
[
'vendor/**/*',
'!vendor/kartik-v/**',
'!vendor/**/*.md',
'!vendor/**/*.txt',
'!vendor/**/*.pdf',
'!vendor/**/LICENSE',
'!vendor/**/CHANGES',
'!vendor/**/README',
'!vendor/**/VERSION',
'!vendor/**/composer.json',
'!vendor/**/.gitignore',
'!vendor/**/docs',
'!vendor/**/docs/**',
'!vendor/**/tests',
'!vendor/**/tests/**',
'!vendor/**/unitTests',
'!vendor/**/unitTests/**',
'!vendor/**/.git',
'!vendor/**/.git/**',
'!vendor/**/examples',
'!vendor/**/examples/**',
'!vendor/**/build.xml',
'!vendor/**/phpunit.xml',
'!vendor/**/phpunit.xml.dist',
'!vendor/**/mpdf/ttfonts/**',
],
{base: '.'}
)
.pipe(zip('vendor.zip'))
.pipe(gulp.dest(paths.deploy));
});
@salarmehr
Copy link
Author

Unfortunately most package development do not employ composer facility to prune their packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment