Frage

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?

War es hilfreich?

Lösung

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 production 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

Andere Tipps

i solve my marge issue as

First Way:

For CSS you need to do something similar to manually enable it. The following has worked for me:

php bin/magento config:set dev/css/merge_css_files 1
php bin/magento config:set dev/css/minify_files 1

php bin/magento config:set dev/js/merge_files 1
php bin/magento config:set dev/js/minify_files 1
 

Another Way:

ENVIRONMENT CONFIGURATION

...
'js' => [
   'merge_files' => '1',
   'minify_files' => '1',
],
'css' => [
    'minify_files' => '1',
    'merge_css_files' => '1',
],
...

Then just do the standard upgrade, compile, deploy sequence.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit magento.stackexchange
scroll top