extract-css-chunks-webpack-plugin icon indicating copy to clipboard operation
extract-css-chunks-webpack-plugin copied to clipboard

Do not add style as body link if it already exists

Open kurtinge opened this issue 4 years ago • 4 comments

When a stylesheet link already exists in the head and preload is supported the stylesheet is added twice.

This is also mentioned in https://github.com/faceyspacey/extract-css-chunks-webpack-plugin/pull/300#issuecomment-752047229

This PR prevent the link from being added to the body if it already is loaded.

kurtinge avatar Jan 08 '21 13:01 kurtinge

@ScriptedAlchemy can we get this merged in and released?

Lighthouse penalizes this fairly heavily:

Screen Shot 2021-01-20 at 4 13 13 PM

t1mwillis avatar Jan 21 '21 02:01 t1mwillis

@ScriptedAlchemy, big request, merge and publish the fix, if you will have at least a little time

SuperOleg39 avatar Apr 06 '21 13:04 SuperOleg39

ooh man thx!

shinelp100 avatar Jun 07 '21 13:06 shinelp100

I have tested this and it is working well. The problem I had was because I hadn't set the publicPath in for the build, but now it works!

iPrytz avatar Sep 22 '21 20:09 iPrytz

I can confirm that this PR fix the problem, but at this point I don't expect to be merged any time soon, my solution was to use patch-package to apply the fix direct to the node_modules/extract-css-chunks-webpack-plugin/dist/index.js file

If you are using [email protected] just create this file on the patches folder and follow the "Set-up" instruction on patch-package page.

luizotcarvalho avatar Sep 12 '23 00:09 luizotcarvalho

Sorry <3 its been a while hehe

ScriptedAlchemy avatar Sep 15 '23 02:09 ScriptedAlchemy

released

ScriptedAlchemy avatar Sep 15 '23 02:09 ScriptedAlchemy