MikaAK / s3-plugin-webpack

Uploads files to s3 after complete
MIT License
486 stars 125 forks source link

Upload html file in bucket root directory #110

Closed Theo-Le-Donne closed 6 years ago

Theo-Le-Donne commented 6 years ago

Complete the following or your issue will be deleted (delete me after)

Please complete these steps and check these boxes (by putting an x inside the brackets) before filing your issue:

Thank you for adhering to this process! This ensures that I can pay attention to issues that are relevant and answer questions faster.

Issue Details

If filing a bug report, please include a list of steps that describe how to reproduce the bug you are experiencing. Include your config being passed to the S3Plugin.

Hi, this may be a really obvious question or i may not have understand well how S3 works.

Is there a way to override the default behaviour and upload html files to the root of the bucket (so without using the directory option) ? Specifying html in include doesn't have any effect : new S3Plugin({ s3Options: { credentials: new AWS.SharedIniFileCredentials({ profile: "profile-name" }) }, s3UploadOptions: { Bucket: "bucket-name", }, include: /.*\.(html|js|css)/, })

Or can i use the directory option and redirect the output to the root of the bucket ?

Ultimately i want to update the index.html file, which is the source file of the bucket, every time i build because it contains a link to the changing hashed css file. (Maybe this is a bad practice and the source of my issue)

Thank you

MikaAK commented 6 years ago

Use basePathTransform it's in the readme