Get URL to React CSS File

Viewed 164

I created a Keycloak theme that should use the same CSS as the React App it is interacting with. Because I don't want the browser to download the same CSS (and fonts) twice I would like to link to the React CSS.

However React does not expose a 'plain' link, it rebundles the css and hosts it under something like static/css/2.3479a581.chunk.css

Can I expose a permanent link from React that I can reference in the theme from Keycloak?

1 Answers

Since this question is missing an answer I'll post the comment I got from ijmacd on reddit:

React doesn't do anything like that.

This is the job of a bundler. Webpack is very popular and if you used create-react-app then this is what you'll be using.

As far as I'm aware the only way to do what you're after (if you used create-react-app) is to eject. Then you can tweak the configuration as you like. Note this is a one way operation and you won't be able to update to newer packages as easily.

Related