How To Merge CSS, Javascript In Magento 2

To decrease page loading time and enhance your site you can combine the CSS files and Javascript files into one particular file. After merging the CSS and Javascript file, it will be disabled to change the file.

Do follow the steps to enable merge CSS and Javascript files: 

Merge Javascript files in Magento 2  

  • In the Admin panel, go to STORES > Settings > Configuration.

Screenshot_276__1.png

  • Click on the Advanced to expand and choose the Developer.

Screenshot_286_.png

  • Expand it and click on the Javascript Settings and do the following.

Screenshot_287_.png

  • In the field of Merge Javascript Files, choose Yes.
  • To save settings click on the Save Button.

 

Merge CSS Files In Magento 2

  • In the Admin panel, go to STORES > Settings > Configuration.

Screenshot_276__1.png

  • Click on the Advanced to expand and choose the Developer.

Screenshot_286_.png

  • To expand click in the CSS settings and do the following.

Screenshot_288_.png

  • In the field of Merge CSS Files, choose Yes
  • To save settings click on the Save Button.

 

If you want to develop a Magento 2 website, visit Magento 2 web agency.