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.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
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.