How to move all css and js to the bottom of html.html.twig?

by user2951257   Last Updated November 15, 2017 00:07 AM

We are using Drupal 8.3 and have created a subtheme where we have the html.html.twig file. The goal is to move the css and js all to the bottom of the page (currently the js-placeholder and css-placeholder are located in the header) to improve performance. We have tried the following below but having trouble figuring out which one to use since they do increase performance but it is hard to figure out which one is the correct way to do it. Additionally, when we enable the css and js aggregation we cannot seem to get those to show up in the bottom of the page.

Method 1: Move the css-placeholder and js-placeholder to the bottom of the body tag.

Method 2: update the mytheme.libraries.yml file to add a weight so that it will load with a lower priority.

Related Questions

Drupal 8 How to inline CSS after Aggregate CSS files

Updated January 11, 2018 11:07 AM

Advagg and Nginx

Updated August 02, 2016 08:03 AM