Magento 2 : Merge and minify js and css












1














It appears that there is no longer a "Developer" tab in the Admin Configuration/Advanced tab in version 2.2.5 production mode. Although the documentation still indicates there is, I have seen a couple of references in the blogs about its removal.



I am trying to figure out how to minify and merge my js and css files, or if I really should?










share|improve this question





























    1














    It appears that there is no longer a "Developer" tab in the Admin Configuration/Advanced tab in version 2.2.5 production mode. Although the documentation still indicates there is, I have seen a couple of references in the blogs about its removal.



    I am trying to figure out how to minify and merge my js and css files, or if I really should?










    share|improve this question



























      1












      1








      1


      1





      It appears that there is no longer a "Developer" tab in the Admin Configuration/Advanced tab in version 2.2.5 production mode. Although the documentation still indicates there is, I have seen a couple of references in the blogs about its removal.



      I am trying to figure out how to minify and merge my js and css files, or if I really should?










      share|improve this question















      It appears that there is no longer a "Developer" tab in the Admin Configuration/Advanced tab in version 2.2.5 production mode. Although the documentation still indicates there is, I have seen a couple of references in the blogs about its removal.



      I am trying to figure out how to minify and merge my js and css files, or if I really should?







      magento2 admin magento-2.2.5 merge-css minify






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 2 days ago









      Vivek Kumar

      2,4242629




      2,4242629










      asked Aug 31 '18 at 15:31









      DStephensDStephens

      83




      83






















          1 Answer
          1






          active

          oldest

          votes


















          1














          Minifying and merging js and css can improve load times and general performance of your store, so it should be enabled in production mode, but if you have to do any kind of development then you should not enable it.



          In developer mode the developer tab in admin store configuration in removed so you have to manually enter values in db to enable and disable them.



          Following are the fields you need to set 0 or 1 in core_config_data table to disable/enable these settings;



          dev/js/merge_files  - Merge Js
          dev/js/minify_files - Minify Js

          dev/css/merge_css_files - Merge css
          dev/css/minify_files - Minify css


          You can also choose to bundle js files, which would reduce the number of requests done to site to improve load times by setting following ;



          dev/js/enable_js_bundling - Bundle Js Files


          Do not forget to deploy your static content and flush cache using following commands after modifying any of these fields;



          php bin/magento setup:static-content:deploy
          chmod 777 -R var pub generated
          php bin/magento cache:flush





          share|improve this answer























          • Thanks for the input! After changing the settings, alot of things don't display properly on the website. But I did get an 'A' from google pagespeed :-/ I suspect the theme I am using can't handle the js bundling. Unfortunately, when I tried to set the fields back to 0 in core_config_data and then deploy static content, I received an error- PHP Fatal error: Uncaught Error: Call to a member function getPackage() on null in /home/199035.cloudwaysapps.com/yzsaztxymz/public_html/vendor/magento/module-deploy/Package/Processor/PostProcessor/CssUrls.php:215
            – DStephens
            Aug 31 '18 at 23:01










          • rename your pub/static and var folder and re run deploy
            – Vivek Kumar
            Aug 31 '18 at 23:03










          • Also please mark the answer as accepted if it helped.
            – Vivek Kumar
            Aug 31 '18 at 23:04










          • That cleared it up. Thanks again!
            – DStephens
            Sep 1 '18 at 18:38











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "479"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f240460%2fmagento-2-merge-and-minify-js-and-css%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          Minifying and merging js and css can improve load times and general performance of your store, so it should be enabled in production mode, but if you have to do any kind of development then you should not enable it.



          In developer mode the developer tab in admin store configuration in removed so you have to manually enter values in db to enable and disable them.



          Following are the fields you need to set 0 or 1 in core_config_data table to disable/enable these settings;



          dev/js/merge_files  - Merge Js
          dev/js/minify_files - Minify Js

          dev/css/merge_css_files - Merge css
          dev/css/minify_files - Minify css


          You can also choose to bundle js files, which would reduce the number of requests done to site to improve load times by setting following ;



          dev/js/enable_js_bundling - Bundle Js Files


          Do not forget to deploy your static content and flush cache using following commands after modifying any of these fields;



          php bin/magento setup:static-content:deploy
          chmod 777 -R var pub generated
          php bin/magento cache:flush





          share|improve this answer























          • Thanks for the input! After changing the settings, alot of things don't display properly on the website. But I did get an 'A' from google pagespeed :-/ I suspect the theme I am using can't handle the js bundling. Unfortunately, when I tried to set the fields back to 0 in core_config_data and then deploy static content, I received an error- PHP Fatal error: Uncaught Error: Call to a member function getPackage() on null in /home/199035.cloudwaysapps.com/yzsaztxymz/public_html/vendor/magento/module-deploy/Package/Processor/PostProcessor/CssUrls.php:215
            – DStephens
            Aug 31 '18 at 23:01










          • rename your pub/static and var folder and re run deploy
            – Vivek Kumar
            Aug 31 '18 at 23:03










          • Also please mark the answer as accepted if it helped.
            – Vivek Kumar
            Aug 31 '18 at 23:04










          • That cleared it up. Thanks again!
            – DStephens
            Sep 1 '18 at 18:38
















          1














          Minifying and merging js and css can improve load times and general performance of your store, so it should be enabled in production mode, but if you have to do any kind of development then you should not enable it.



          In developer mode the developer tab in admin store configuration in removed so you have to manually enter values in db to enable and disable them.



          Following are the fields you need to set 0 or 1 in core_config_data table to disable/enable these settings;



          dev/js/merge_files  - Merge Js
          dev/js/minify_files - Minify Js

          dev/css/merge_css_files - Merge css
          dev/css/minify_files - Minify css


          You can also choose to bundle js files, which would reduce the number of requests done to site to improve load times by setting following ;



          dev/js/enable_js_bundling - Bundle Js Files


          Do not forget to deploy your static content and flush cache using following commands after modifying any of these fields;



          php bin/magento setup:static-content:deploy
          chmod 777 -R var pub generated
          php bin/magento cache:flush





          share|improve this answer























          • Thanks for the input! After changing the settings, alot of things don't display properly on the website. But I did get an 'A' from google pagespeed :-/ I suspect the theme I am using can't handle the js bundling. Unfortunately, when I tried to set the fields back to 0 in core_config_data and then deploy static content, I received an error- PHP Fatal error: Uncaught Error: Call to a member function getPackage() on null in /home/199035.cloudwaysapps.com/yzsaztxymz/public_html/vendor/magento/module-deploy/Package/Processor/PostProcessor/CssUrls.php:215
            – DStephens
            Aug 31 '18 at 23:01










          • rename your pub/static and var folder and re run deploy
            – Vivek Kumar
            Aug 31 '18 at 23:03










          • Also please mark the answer as accepted if it helped.
            – Vivek Kumar
            Aug 31 '18 at 23:04










          • That cleared it up. Thanks again!
            – DStephens
            Sep 1 '18 at 18:38














          1












          1








          1






          Minifying and merging js and css can improve load times and general performance of your store, so it should be enabled in production mode, but if you have to do any kind of development then you should not enable it.



          In developer mode the developer tab in admin store configuration in removed so you have to manually enter values in db to enable and disable them.



          Following are the fields you need to set 0 or 1 in core_config_data table to disable/enable these settings;



          dev/js/merge_files  - Merge Js
          dev/js/minify_files - Minify Js

          dev/css/merge_css_files - Merge css
          dev/css/minify_files - Minify css


          You can also choose to bundle js files, which would reduce the number of requests done to site to improve load times by setting following ;



          dev/js/enable_js_bundling - Bundle Js Files


          Do not forget to deploy your static content and flush cache using following commands after modifying any of these fields;



          php bin/magento setup:static-content:deploy
          chmod 777 -R var pub generated
          php bin/magento cache:flush





          share|improve this answer














          Minifying and merging js and css can improve load times and general performance of your store, so it should be enabled in production mode, but if you have to do any kind of development then you should not enable it.



          In developer mode the developer tab in admin store configuration in removed so you have to manually enter values in db to enable and disable them.



          Following are the fields you need to set 0 or 1 in core_config_data table to disable/enable these settings;



          dev/js/merge_files  - Merge Js
          dev/js/minify_files - Minify Js

          dev/css/merge_css_files - Merge css
          dev/css/minify_files - Minify css


          You can also choose to bundle js files, which would reduce the number of requests done to site to improve load times by setting following ;



          dev/js/enable_js_bundling - Bundle Js Files


          Do not forget to deploy your static content and flush cache using following commands after modifying any of these fields;



          php bin/magento setup:static-content:deploy
          chmod 777 -R var pub generated
          php bin/magento cache:flush






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Aug 31 '18 at 17:38

























          answered Aug 31 '18 at 17:05









          Vivek KumarVivek Kumar

          2,4242629




          2,4242629












          • Thanks for the input! After changing the settings, alot of things don't display properly on the website. But I did get an 'A' from google pagespeed :-/ I suspect the theme I am using can't handle the js bundling. Unfortunately, when I tried to set the fields back to 0 in core_config_data and then deploy static content, I received an error- PHP Fatal error: Uncaught Error: Call to a member function getPackage() on null in /home/199035.cloudwaysapps.com/yzsaztxymz/public_html/vendor/magento/module-deploy/Package/Processor/PostProcessor/CssUrls.php:215
            – DStephens
            Aug 31 '18 at 23:01










          • rename your pub/static and var folder and re run deploy
            – Vivek Kumar
            Aug 31 '18 at 23:03










          • Also please mark the answer as accepted if it helped.
            – Vivek Kumar
            Aug 31 '18 at 23:04










          • That cleared it up. Thanks again!
            – DStephens
            Sep 1 '18 at 18:38


















          • Thanks for the input! After changing the settings, alot of things don't display properly on the website. But I did get an 'A' from google pagespeed :-/ I suspect the theme I am using can't handle the js bundling. Unfortunately, when I tried to set the fields back to 0 in core_config_data and then deploy static content, I received an error- PHP Fatal error: Uncaught Error: Call to a member function getPackage() on null in /home/199035.cloudwaysapps.com/yzsaztxymz/public_html/vendor/magento/module-deploy/Package/Processor/PostProcessor/CssUrls.php:215
            – DStephens
            Aug 31 '18 at 23:01










          • rename your pub/static and var folder and re run deploy
            – Vivek Kumar
            Aug 31 '18 at 23:03










          • Also please mark the answer as accepted if it helped.
            – Vivek Kumar
            Aug 31 '18 at 23:04










          • That cleared it up. Thanks again!
            – DStephens
            Sep 1 '18 at 18:38
















          Thanks for the input! After changing the settings, alot of things don't display properly on the website. But I did get an 'A' from google pagespeed :-/ I suspect the theme I am using can't handle the js bundling. Unfortunately, when I tried to set the fields back to 0 in core_config_data and then deploy static content, I received an error- PHP Fatal error: Uncaught Error: Call to a member function getPackage() on null in /home/199035.cloudwaysapps.com/yzsaztxymz/public_html/vendor/magento/module-deploy/Package/Processor/PostProcessor/CssUrls.php:215
          – DStephens
          Aug 31 '18 at 23:01




          Thanks for the input! After changing the settings, alot of things don't display properly on the website. But I did get an 'A' from google pagespeed :-/ I suspect the theme I am using can't handle the js bundling. Unfortunately, when I tried to set the fields back to 0 in core_config_data and then deploy static content, I received an error- PHP Fatal error: Uncaught Error: Call to a member function getPackage() on null in /home/199035.cloudwaysapps.com/yzsaztxymz/public_html/vendor/magento/module-deploy/Package/Processor/PostProcessor/CssUrls.php:215
          – DStephens
          Aug 31 '18 at 23:01












          rename your pub/static and var folder and re run deploy
          – Vivek Kumar
          Aug 31 '18 at 23:03




          rename your pub/static and var folder and re run deploy
          – Vivek Kumar
          Aug 31 '18 at 23:03












          Also please mark the answer as accepted if it helped.
          – Vivek Kumar
          Aug 31 '18 at 23:04




          Also please mark the answer as accepted if it helped.
          – Vivek Kumar
          Aug 31 '18 at 23:04












          That cleared it up. Thanks again!
          – DStephens
          Sep 1 '18 at 18:38




          That cleared it up. Thanks again!
          – DStephens
          Sep 1 '18 at 18:38


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f240460%2fmagento-2-merge-and-minify-js-and-css%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          An IMO inspired problem

          Management

          Investment