DEV Community

Discussion on: Build a static site generator with webpack

pldg profile image
Luca Author

Can you setup a minimal repository to view?

ansimorph profile image
Björn Ganslandt

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:

Minicssextract has the same issue:

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.