nuxt-image-loader-module icon indicating copy to clipboard operation
nuxt-image-loader-module copied to clipboard

how to point URL to an s3 bucket after generation?

Open simonhrogers opened this issue 6 years ago • 2 comments

Hello! Thanks very much for your work on this module, it is brilliant.

Can you point me in the right direction? I am looking for a way to point the URL to my s3 bucket e.g. https://s3.eu-west-2.amazonaws.com/assets.my-website.org/slides after statically generating my site.

Previously I was adding the string: https://s3.eu-west-2.amazonaws.com/assets.my-website.org/slides through a computed property in my code.

This method no longer works because this prevents nuxt-image-loader-module from finding the images and correctly generating my application. I need a way of pointing all image URLs to my s3 after this has been done.

How can I do this? What is the standard approach for this?

Many Thanks,

Simon

simonhrogers avatar Feb 06 '19 18:02 simonhrogers

Hi Simon,

Thanks for raising this issue and for your kind words.

S3 integration isn't something that I've tested so far. I can add this to the roadmap for this plugin, although I can't immediately put my attention on this due to busy work commitments.

I think S3 integration would be a worthy addition and as you have a real use case, I'd like to ask you a few questions so that I understand what you're trying to achieve.

Are you trying to:

  • Put your entire compiled nuxt app on S3 and host from there
  • Retrieve existing source images from an S3 bucket?
  • Point the compiled <img> sources to a remote S3 bucket where the compiled images live?
  • Is you S3 bucket publicly accessible - i.e. no access permissions set?

I'd like to see if there is a general solution that's not necessarily S3 specific so this module can support other image hosting solutions.

Thanks,

Barry

Barry-Fisher avatar Feb 07 '19 13:02 Barry-Fisher

Thanks Barry!

I’m not well versed in best practices for asset storage – so I was posing a question about how would be best to handle this as much as anything.

I am hosting my app from Netlify currently, and had thought it would be nice to store all image assets on a separate s3 bucket, attached to a subdomain e.g. assets.my-domain.com

Given this idea, I had thought it would be nice if during the build / generation process, assets could be generated and then uploaded to this bucket – with links amended appropriately.

With this in mind, I think my objective is as you describe in your third point:

  • Point the compiled <img> sources to a remote S3 bucket where the compiled images live?

The assets could certainly be made public if necessary or easier!

Thanks,

Simon

simonhrogers avatar Feb 11 '19 12:02 simonhrogers