diff --git a/packages/optimizer/lib/transformers/ReorderHeadTransformer.js b/packages/optimizer/lib/transformers/ReorderHeadTransformer.js index 5147fd25c..b420c2e36 100644 --- a/packages/optimizer/lib/transformers/ReorderHeadTransformer.js +++ b/packages/optimizer/lib/transformers/ReorderHeadTransformer.js @@ -25,9 +25,9 @@ class HeadNodes { this._metaCharset = null; this._scriptAmpEngine = null; this._metaOther = []; + this._resourceHintLinks = []; this._scriptRenderDelayingExtensions = []; this._scriptNonRenderDelayingExtensions = []; - this._resourceHintLinks = []; this._linkIcons = []; this._styleAmpCustom = null; this._linkStylesheetsBeforeAmpCustom = []; @@ -63,11 +63,11 @@ class HeadNodes { appendChild(head, this._linkStyleAmpRuntime); appendChild(head, this._styleAmpRuntime); appendAll(head, this._metaOther); + appendAll(head, this._resourceHintLinks); appendChild(head, this._scriptAmpEngine); appendAll(head, this._scriptRenderDelayingExtensions); appendAll(head, this._scriptNonRenderDelayingExtensions); appendAll(head, this._linkIcons); - appendAll(head, this._resourceHintLinks); appendAll(head, this._linkStylesheetsBeforeAmpCustom); appendChild(head, this._styleAmpCustom); appendAll(head, this._others); diff --git a/packages/optimizer/spec/transformers/valid/ReorderHeadTransformer/optimize_move_resource_hints_top/expected_output.html b/packages/optimizer/spec/transformers/valid/ReorderHeadTransformer/optimize_move_resource_hints_top/expected_output.html index 0ab84dff2..f7095db3b 100644 --- a/packages/optimizer/spec/transformers/valid/ReorderHeadTransformer/optimize_move_resource_hints_top/expected_output.html +++ b/packages/optimizer/spec/transformers/valid/ReorderHeadTransformer/optimize_move_resource_hints_top/expected_output.html @@ -2,14 +2,14 @@ - - - - + + + + diff --git a/packages/optimizer/spec/transformers/valid/ReorderHeadTransformer/supports_esm/expected_output.html b/packages/optimizer/spec/transformers/valid/ReorderHeadTransformer/supports_esm/expected_output.html index bef858f53..1b3559336 100644 --- a/packages/optimizer/spec/transformers/valid/ReorderHeadTransformer/supports_esm/expected_output.html +++ b/packages/optimizer/spec/transformers/valid/ReorderHeadTransformer/supports_esm/expected_output.html @@ -2,13 +2,13 @@ + -