Since Magento 2.4.2, to speed up static content deployment, specific your theme by using --theme
option and using --no-parent
option when running bin/magento setup:static-content:deploy
command. By doing that, Magento only generates your theme, not generate parent themes like Magento/luma
, Magento/blank
,...
That equals: don't run bin/magento setup:static-content:deploy
without any options.
- For frontend: Assume your frontend theme is:
TuVan/XLuma
, you should run the following command for frontend:
bin/magento setup:static-content:deploy -f --area frontend --theme TuVan/XLuma --no-parent
- For admin:
- Case 1: Assume you use a custom admin theme, it is
TuVan/backend
, you should run the following command for admin:
bin/magento setup:static-content:deploy -f --area adminhtml --theme TuVan/backend --no-parent
- Case 2: Assume you are not using any custom admin theme, you should run the following command for admin:
bin/magento setup:static-content:deploy -f --area adminhtml
You can read more options for bin/magento setup:static-content:deploy
here: https://experienceleague.adobe.com/docs/commerce-operations/configuration-guide/cli/static-view/static-view-file-deployment.html