npm.io
1.2.4 • Published 7 years agoCLI

s3-asset-upload

Licence
ISC
Version
1.2.4
Deps
3
Size
5 kB
Vulns
1
Weekly
0

S3 asset upload

A simple script to batch upload your project assets to s3.

We use the environment, which is ideal for build pipelines.

Usage

Set env

S3_PATH=./.nuxt/dist/client
S3_BUCKET=cdn.my-project.com
AWS_SECRET_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE
AWS_ACCESS_KEY_ID=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

# Default values
S3_CACHE_CONTROL=max-age=604800,
S3_ACL=private, # change this to `public-read` if you want to serve assets directly from s3
S3_GZIP=true,
S3_IMG_TYPES=jpg,gif,png,
S3_FILE_TYPES=js,map,json,
S3_PREFIX='',
S3_IGNORE=undefined,
S3_DEBUG=false,
S3_BATCH_LIMIT=10

Run script on the CLI

$ yarn --global add s3-asset-upload
$ s3-asset-upload

Run in npm scripts

package.json
{
  "scripts": {
    "upload-assets": "s3-asset-upload"
  }
}

$ yarn upload-assets

Keywords