Magento 2 : Merge and minify js and css
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
add a comment |
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
add a comment |
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
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
magento2 admin magento-2.2.5 merge-css minify
edited 2 days ago
Vivek Kumar
2,4242629
2,4242629
asked Aug 31 '18 at 15:31
DStephensDStephens
83
83
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
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
add a comment |
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
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
add a comment |
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
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
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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