I am a freelance frontend developer based in Vienna. I have a background in design theory and like to bring good designs to live with the help of CSS, JS and HTML.
Is there a way to use this approach with css components?
When I try, style loader always fails with: ERROR in Template execution failed: ReferenceError: window is not defined.
I am a freelance frontend developer based in Vienna. I have a background in design theory and like to bring good designs to live with the help of CSS, JS and HTML.
Is there a way to use this approach with css components?
When I try, style loader always fails with: ERROR in Template execution failed: ReferenceError: window is not defined.
I'll set up a minimal repo when I find time, but meanwhile I figured out what the problem is in case anyone trips over the same problem.
Style-loader expects a DOM, which isn't there yet in the context of HtmlWebpackPlugin rendering the pages:
github.com/webpack-contrib/style-l...
Minicssextract has the same issue:
github.com/webpack-contrib/mini-cs...
So this boils down to a SSR problem for which the mini-css-extract issue discusses some possible solutions.
I ended up going the conventional way and included the css in a js-entrypoint.