Mini-css-extract-plugin: Don't refetch a CSS chunk if it's inlined into the HTML <head>

Created on 23 Mar 2018  Â·  2Comments  Â·  Source: webpack-contrib/mini-css-extract-plugin

In Gatsby v2, we'll be using webpack 4 and mini-css-extract-plugin. Gatsby tries to always inline the critical CSS for a page — which aligns perfectly with mini-css-extract-plugin's goals. Currently, however, if we inline a CSS chunk, it'll still be loaded once the webpack runtime loads in the client. Discussing this with @sokra, he suggested that we'd adopt a convention where if you add a data-href to the <style> tag that then webpack wouldn't reload the inlined css.

Most helpful comment

All 2 comments

has the fix been published to npm? seems like it still having the old code

Was this page helpful?
0 / 5 - 0 ratings