score:2
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.
Source: stackoverflow.com
Related Query
- React/webpack - How can I host react app on one server and images/fonts on another server?
- How can I start my node server and react app at the same time?
- How can I build a React app with Webpack and import an assets folder?
- How to deploy and host react app on Apache server
- How to inject port and host using ENV variable in Create React App Proxy settings?
- how to share environment variables between react app and express js server hosting it as static site
- How to reduce react app build time and understanding behaviour of webpack when bundling
- How can I prevent drag and drop images in a react app?
- How to use images from sharp module in React and Webpack project
- How we can convert client side rendering react js app to server side rendering using react router 4?
- how to fetch and display images from database in react app
- how to run my node application and react app in the same time with one command?
- React Microfronends: How do I pass authentication and other information from one Front end app to another Front end app?
- How to determine the order of css in my create react app build with webpack and customize-cra?
- how can i host react app in IIS web server?
- Proxying requests from client react app to server with create-react-app and webpack dev server
- REACT: How to create a reusable custom hook with functions and effects that can change & react to changes in a host component's data
- What can cause fonts and images to be downloaded twice when using React with SSR?
- How can I create a configuration file for react and prevent webpack bundling it?
- How could I hide api key in my React app and host the working version in Github
- How can I setup my react app in ubuntu server
- How can I create a counter as components to use multiple times and create one button to reset all the counter in React JS?
- React SSR(Server Side Rendering) for SEO before login and after login Create React App (CRA). How to do this in one project folder?
- How can I inject a span into a string and have it printed in my react app as HTML
- How can I change the URL for a React app that I'm hosting myself and to which I forward a domain?
- Im using React Router and I want one of my route links with path="/" to be the home page on reload.. How can you do that?
- How to correctly load .otf/.tff fonts in a React app via a Webpack pipeline?
- How can I pass props from one component to another using Link and router in react
- How can I format time using moment.js in React JS and webpack
- I create a build of my react app and connected with electron.js. now how to connect my backend from server folder with electron
More Query from same tag
- Performance comparison between react hooks and react class
- make behavior of components independent
- How to get ref from a React 16 portal?
- No tooltips lines displayed in line chart - dc.js,d3 v4.2.8,React
- Can ReactJS initialize its state based on a server-side rendered DOM?
- select multiple platform using redux
- React Hooks: Refresh data on goBack()
- React - Image paths changing to relative when address bar entered directly
- What is the proper way to update multiple objects in an array of objects in react?
- What's render props, how is it different from high order components?
- React front end is not communicating with spring boot REST API. Axios network err in console
- Uncaught TypeError: Cannot read property 'props' of null in React
- I want to test if the routes exist
- React + Webpack bundling - if node_modules are excluded 'require is not defined' in browser
- Best way to handle conditional parent containers in React?
- How to display modal without backdrop effect with react-modal?
- performance: connecting to the Redux store vs passing data through props
- How to call debounce method within one function?
- CORS Issue With Ktor Backend
- React redux Sagas, wait for a Saga to set state
- Use Single React-Toastr Container For All Messages
- Fetching JSON returns error Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0 and status code 304: Not Modified
- How to set state in a React component using this.setState without explicitly passing the field name to update?
- Make typescript see props from decorators
- How to fix "Module build failed: SyntaxError: Unexpected token" error when using React and Webpack?
- How do I use percentages with MotionValues in Framer Motion?
- I am trying to create Navbar using Bootsrap 5 in react js but my dropdown button not working
- How import statement works in ES6 for React Components
- ReactJS Form Input - can't get a "const" variable in validation function
- Changing to '@mui/material' makes the components not rendered