gulp-s3-publish

3.0.0 • Public • Published

gulp-s3-publish NPM version

s3 plugin for gulp

Info

This plugin started as a fork of gulp-s3.

Recently updated for Gulp 4 and added support for cleaning orphan files from an S3 bucket. Plugin API has changed since the 2.x release.

Please open an issue for feature requests.

Usage

First, install gulp-s3-publish and aws-sdk as a development dependency:

npm install --save-dev gulp-s3-publish aws-sdk

Then, use it in your Gulpfile.js:

const { upload, clean } = require('gulp-s3-publish');
const { S3 } = require('aws-sdk'); 
 
const client = S3();
 
const uploadOpts = {
  bucket: 'my-s3-bucket',
  // uploadPath: 's3/upload/path',
  // delay: 0,
  // maxConcurrency: 1,
  putObjectParams: {
    ACL: 'public-read'
  },
  // dryRun: false,
};
 
const cleanOpts = {
  bucket: 'my-s3-bucket',
  // uploadPath: 's3/upload/path'
  // whitelist: [
  //   { type: 'key', path: 'keep-this-file.txt' },
  //   { type: 'keyPrefix', path: 'keep-this-path' },
  // ],
  // dryRun: false,
};
 
// Upload files to S3
// and clean orphaned files
gulp.task('deploy', () => {
  return gulp.src('./dist/**/*')
    .pipe(upload(client, uploadOpts))
    .pipe(clean(client, cleanOpts))
});
 

License

MIT License

Readme

Keywords

Package Sidebar

Install

npm i gulp-s3-publish

Weekly Downloads

51

Version

3.0.0

License

MIT

Unpacked Size

11.4 kB

Total Files

12

Last publish

Collaborators

  • adrianfalleiro