# create-react-app-s3-uploader

> webpack plugin ( for create-react-app ), when source build on production, this plugin upload static directory to aws s3 bucket

Latest version **1.0.1** (published 2018-05-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install create-react-app-s3-uploader
pnpm add create-react-app-s3-uploader
yarn add create-react-app-s3-uploader
bun add create-react-app-s3-uploader
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-05-06 |
| First published | 2018-05-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 6.10.0 |
| Dependencies | 1 |
| Unpacked size | 3.7 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 6 |
| Author | kimcoder |
| Maintainers | kimcoder |
| Keywords | reactjs, create-react-app, aws, s3, webpack |

## Links

- npm: https://www.npmjs.com/package/create-react-app-s3-uploader
- Repository: https://github.com/kimcoder/create-react-app-s3-uploader
- Homepage: https://github.com/kimcoder/create-react-app-s3-uploader#readme
- Issues: https://github.com/kimcoder/create-react-app-s3-uploader/issues
- npm.io page: https://npm.io/package/create-react-app-s3-uploader

## Dependencies (1)

- [aws-sdk](https://npm.io/package/aws-sdk.md) ^2.229.1

## 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

- 1.0.1 (latest) — 2018-05-06
- 1.0.0 — 2018-05-06

## README

# Create React App S3 Uploader
`create-react-app-s3-uploader`는 webpack 플러그인이며 [create-react-app](https://github.com/facebook/create-react-app) 환경에서 사용을 목적으로 제작하였습니다.<br>
production 환경에서 react를 빌드하였을 시, static 디렉토리의 소스들을 aws s3의 버킷에 업로드 해줍니다.

`create-react-app-s3-uploader` is webpack plugin. (for [create-react-app](https://github.com/facebook/create-react-app)).<br>
When react builded on production, this plugin upload static directory to aws s3 bucket

## install
```
npm install --save create-react-app-s3-uploader
```

## usage
가장 우선, `create-react-app` project에서 `npm eject`를 실행시켜줘야 합니다.<br>
first of all, you shoud run `npm eject` in your `create-react-app` project

**webpack.config.prod.js**
```
const CreateReactAppS3Uploader = require("create-react-app-s3-uploader");

module.exports = {
    plugins: [
        new CreateReactAppS3Uploader({
            accessKeyId: {AWS ACCESS KEY },
            secretAccessKey: { AWS SECRET KEY },
            buildPath: paths.appBuild,
            region: "ap-northeast-2",
            bucket: "create-react-app-s3-uploader",
        })
    ]
};
```
**CreateReactAppS3Uploader Parameters**

|Name|Type|Required|Description|
|:--:|:--:|:-----:|:----------|
|**accessKeyId**|`{String}`|Required|AWS Access Key|
|**secretAccessKey**|`{String}`|Required|AWS Secret Key|
|**buildPath**|`{String}`|Required|`create-react-app` build directory path|
|**region**|`{String}`|Required|AWS S3 Region|
|**bucket**|`{String}`|Required|AWS S3 Bucket|
|**key**|`{String}`|Optional|If you set this param, you can upload to specific directory in your s3 bucket|
|**acl**|`{String}`|Optional|AWS S3 ACL, default `public-read`|
|**cloudfront**|`{String}`|Optional|S3's CloudFront Domain.|
|**replaceHtml**|`{boolean}`|Optional|default `false`. If you set to `true`, automatically change index.html's css & js's src to uploaded url|

## Example
![Example S3](/example_s3.gif)
<br>live demo gif ( upload to s3 )

![Example CloudFront](/example_cloudfront.gif)
<br>live demo gif ( upload to cloudfront )

## Reference
- ACL : [AWS ACL LIST](https://docs.aws.amazon.com/ko_kr/AmazonS3/latest/dev/acl-overview.html)
- Content-Type : [HTTP MIME TYPE](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types)

---
_Source: https://npm.io/package/create-react-app-s3-uploader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
