Server-rendering + webpack... styles?
See original GitHub issueI’m using React server-rendering and webpack, which works, however the CSS isn’t server rendered.
I’ve looked at this page: https://fontawesome.com/how-to-use/server-side-rendering, however it’s not clear to me how to get the CSS from @fortawesome/fontawesome
to be picked up by webpack and included in my CSS bundle.
I also need to stop the inserting of the <style>
tag in the <head>
by the client-side fontawesome
js.
Server-rendering with js disabled in the browser means no CSS for font awesome (the base styles), so I’m seeing this:
If the CSS is missing when this icon displays in the browser it will flash from a very large icon down to a properly sized one a moment later.
Are there any solutions for this…?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:12 (1 by maintainers)
Top Results From Across the Web
Enabling assets for Server-Side Rendering in Webpack
One existing solution is webpack-isomorphic-tools, but I found this very hard to set up ... fake-style-loader enables loading CSS modules on the server....
Read more >Adding style to Server-Side rendering and automating the ...
1 Implementing Server Side Rendering using React and Express 2 Adding style to Server-Side rendering and automating the build process.
Read more >Server-Side Rendering - SurviveJS
Server -Side Rendering (SSR) is a technique that allows you to serve an initial payload with HTML, JavaScript, CSS, and even application state....
Read more >Intro to React Server Side Rendering | by Suhan Wijaya
[B] This tells webpack to preprocess .js files with babel-loader , which transpiles ES6+ and JSX code into JavaScript code that is readable...
Read more >React server side rendering - failure on `style-loader` of ...
How do I resolve this error? var path = require('path'); var webpack = require('webpack'); var nodeExternals = require('webpack-node-externals' ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In the latest release of
@fortawesome/fontawesome
we’ve included the CSS for this as an external file. The packages.json points to it with thestyle
property. I think the postcss plugins will use this value. Let me know if that helps.@stephen-last I think we can close this issue thanks @robmadole