From d96effdbac61b9aecdae9f7be221377d2a3e0f0f Mon Sep 17 00:00:00 2001 From: Sebastian Benz Date: Tue, 6 Apr 2021 21:52:51 +0200 Subject: [PATCH] move resource hints up --- .../optimizer/lib/transformers/ReorderHeadTransformer.js | 4 ++-- .../optimize_move_resource_hints_top/expected_output.html | 8 ++++---- .../supports_esm/expected_output.html | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) 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 @@ + -