# vite-plugin-aws3

> This plugin will deploy assets to AWS (S3 & Cloudfront)

Latest version **0.3.0** (published 2023-02-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install vite-plugin-aws3
pnpm add vite-plugin-aws3
yarn add vite-plugin-aws3
bun add vite-plugin-aws3
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2023-02-23 |
| First published | 2023-02-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 9.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Rares Pop |
| Maintainers | treeletnet |
| Keywords | vite, s3, aws, cloudfront, vite-plugin |

## Links

- npm: https://www.npmjs.com/package/vite-plugin-aws3
- Repository: https://gitea.treelet.net/Treelet/vite-plugin-aws
- Issues: https://gitea.treelet.net/Treelet/vite-plugin-aws/issues
- npm.io page: https://npm.io/package/vite-plugin-aws3

## Dependencies (5)

- [mime](https://npm.io/package/mime.md) ^3.0.0
- [progress](https://npm.io/package/progress.md) ^2.0.3
- [@aws-sdk/client-s3](https://npm.io/package/@aws-sdk/client-s3.md) ^3.276.0
- [@aws-sdk/client-cloudfront](https://npm.io/package/@aws-sdk/client-cloudfront.md) 3.277.0
- [@aws-sdk/credential-providers](https://npm.io/package/@aws-sdk/credential-providers.md) ^3.276.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.3.0 (latest) — 2023-02-23

## README

This plugin will upload all built assets to s3.

This package was heavily inspired by [vite-plugin-s3](https://github.com/sportsrecruits/vite-plugin-s3)

### Install Instructions

```bash
$ npm i vite-plugin-aws3

$ yarn add vite-plugin-aws3
```

##### Import `vite-plugin-aws3` in your vite config file and add it as a vite plugin.

```javascript
import viteAws from 'vite-plugin-aws3';

export default defineConfig({
    plugins: [
        viteAws({
            s3: {
                profile: 'my_aws_profile',
                region: 'us-east-1',
                bucket: 'my-website-bucket',
            },
            cloudFront: {
                distributionId: 'E3IXXXXXXXXXX',
                paths: ['/*'],
            },
        }),
    ]
});
```

##### Config Example

```javascript
viteAws({
    exclude: /.*\.img/,
    include: /.*\.js$/,
    uploadEnabled: !!process.env.UPLOAD_ENABLED,
    s3: {
        profile: 'my_aws_profile',
        region: 'us-east-1',
        bucket: 'my-website-bucket',
    },
    cloudFront: {
        distributionId: 'E3IXXXXXXXXXX',
        paths: ['/*'],
    },
})
```

### Options

| Option            | Type       | Default                   | Description                                                                                                                                                                                 | 
|-------------------|------------|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `uploadEnabled`   | `Boolean`  | `true`                    | This setting can be used to disable or enable the uploading of assets                                                                                                                       |
| `exclude`         | `String`   |                           | A Regex Pattern to match for excluded content                                                                                                                                               |
| `include`         | `String`   |                           | A Regex Pattern to match for `included` content. Behaves the same as `exclude`                                                                                                              |

### Example Usage

```bash
$ UPLOAD_ENABLED=true yarn prod
```

---
_Source: https://npm.io/package/vite-plugin-aws3 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
