1

I'm trying to compress the code files on my magento 2 store. And so we wanted to use the Merge JS/CSS files in the magento 2 admin.

We are not programmers, and we would like to not have to contact programmes to fix any problems because of high cost.

So what i'm wondering is, how big is the chance that something goes wrong with the site when i merge the files? and if anything goes wrong, can i just Unmerge them and everything will be fine?

3
  • you can disable merge css and js using admin backend – Rk Rathod May 16 '19 at 6:55
  • give it a try on your stage site instead of production. – Rizwan Khan May 16 '19 at 7:11
  • back up your magento files and your database - then do whatever you want to do. If you cause problems then you can use your backup. This is a given anyway. ALWAYS back up your database and files before you try anything – Anthony May 16 '19 at 7:50
1

First Change deploy mode into a developer mode

Terminal command

php bin/magento deploy:mode:set developer

Open admin panel and follow the below steps

1.Store->configuration->advanced -> developer

Js minify and merge

Set yes for below configuration under Javascript tab

  • Merge JavaScript Files
  • Enable JavaScript Bundling
  • Minify JavaScript Files

CSS minify and merge

set yes for below configuration under CSS setting

  • Merge CSS Files
  • Minify CSS Files

after set deploy mode into prodcution

Terminal command

php bin/magento deploy:mode:set production

Revert

If you want to revert minify and merge, Set no to above configuration and then change into production mode

Terminal command

php bin/magento deploy:mode:set production
1

You just need to revert back that setting.

if admin not work, then go to PHPMyAdmin

and find entry into core_config_data like

select * from core_config_data where path like '%merge%';

and change entry to 0 and do cache flush then your store will revert back

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.