score:2

Accepted answer

this isn't too bad - i do a similar thing with a couple of my apps. first, get the assets you want onto s3 using an s3 bucket.

there's a good youtube video for that here (this is about uploading from your react app, but the aws setup is similar in some ways): https://www.youtube.com/watch?v=cdj4lptlr3o

so once you have your aws bucket setup, you'll probably have one called "site_images" for example. at that point you can source those images from s3 like you would any other image:

https://camel.assets.s3.amazonaws.com/images/some-image-on-aws

you'd load fonts in a similar way via your css file(s) most likely with something like:

@fontface {
  font-family: 'my awesome font';
  src: url('https://camel.assets.s3.amazonaws.com/fonts/some-font-on-aws')
}

how you do this specifically will depend on your configuration. you'll need to adjust our aws bucket for cors which can be a bit of a snag. these links should should help you in the right direction though!

https://coderwall.com/p/ub8zug/serving-web-fonts-via-aws-s3-and-cloudfront

amazon s3 cors (cross-origin resource sharing) and firefox cross-domain font loading

score:0

did you try to use plugins like webpack-s3-plugin

you can define rules for all assets you need.

and of cause you'll have to eject cra or use something kind of react-app-rewired or rescripts.


Related Query

More Query from same tag