posthtml / htmlnano

Modular HTML minifier, built on top of the PostHTML

Home Page:https://htmlnano.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inline scripts get reordered after minification

snippetkid opened this issue · comments

Inline scripts in <head> are getting pushed to <body> after minification which apparently breaks the intended order. I am using parcel-bundler 1.12.2 with htmlnano 0.2.2

Can you please post an example, where such merge breaks the page? Since all scripts are merged in the same order as they're present on the page, it should break nothing, I guess.

To avoid such merge, I'd suggest adding the same class to all <script> in <head>, so they would be merged into the latest <script> tag in <head>.

Or just disable mergeScripts module.

I'm closing this issue. Feel free to re-open it if you still have this bug.