Static assets relative path with vite + react?

I’d love to use the assets.lib solution in my project. I remixed the glitch-hello-react project… I’m having trouble figuring out how to apply the assets.lib solution to a Vite driven project. Any pointers? Or does anyone know of a ready-baked solution I can grab where someone has done this already? Thanks!

The project you linked to uses Express to proxy requests. The equivalent in a Vite driven project would be to configure a proxy rule:

export default {
  server: {
    proxy: {
      '/assets': {
        target: '',
        changeOrigin: true,
        rewrite: path => path.replace(/^\/assets/, '/INSERT_CDN_TOKEN_HERE')

You can find your CDN token by looking at the URL for one of your uploaded assets. As an example, the following CDN URL:

Has the token: