Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

NotificationsYou must be signed in to change notification settings

kimcoder/create-react-app-s3-uploader

Repository files navigation

create-react-app-s3-uploader는 webpack 플러그인이며create-react-app 환경에서 사용을 목적으로 제작하였습니다.
production 환경에서 react를 빌드하였을 시, static 디렉토리의 소스들을 aws s3의 버킷에 업로드 해줍니다.

create-react-app-s3-uploader is webpack plugin. (forcreate-react-app).
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를 실행시켜줘야 합니다.
first of all, you shoud runnpm eject in yourcreate-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

NameTypeRequiredDescription
accessKeyId{String}RequiredAWS Access Key
secretAccessKey{String}RequiredAWS Secret Key
buildPath{String}Requiredcreate-react-app build directory path
region{String}RequiredAWS S3 Region
bucket{String}RequiredAWS S3 Bucket
key{String}OptionalIf you set this param, you can upload to specific directory in your s3 bucket
acl{String}OptionalAWS S3 ACL, defaultpublic-read
cloudfront{String}OptionalS3's CloudFront Domain.
replaceHtml{boolean}Optionaldefaultfalse. If you set totrue, automatically change index.html's css & js's src to uploaded url

Example

Example S3
live demo gif ( upload to s3 )

Example CloudFront
live demo gif ( upload to cloudfront )

Reference

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp