whenever I bin\magento setup:static-content:deploy it will create all theme or compile all theme

but in my case I need to recompile or rebuild my specific theme in that case how to do it in magento2?


As of 2.1.1 you can now deploy specific themes

Deploy specific themes:

php bin/magento setup:static-content:deploy --theme Magento/backend

Exclude themes:

php bin/magento setup:static-content:deploy --exclude-theme Magento/luma

The following command deploys static content for the US English (en_US) language, excludes the Luma theme provided with Magento, and does not minify HTML files.

magento setup:static-content:deploy en_US --exclude-theme Magento/luma --no-html-minify
| improve this answer | |

There is no way to deploy static files in 2.0.* only for your theme. You need to upgrade to 2.1.1 if you want to deploy specific theme only.

From version 2.1.1 there is --theme option for setup:static-content:deploy command.

php bin/magento setup:static-content:deploy --theme Vendor/mytheme

There is also options for excluding themes or deploy/exclude arias such as adminhtml or frontend.

Check official documentation here

| improve this answer | |
  • can 2.1.0 deploy specific theme? – Ree Nov 4 '16 at 4:36
  • No, it's feature from 2.1.1 – Miroslav Petroff Nov 4 '16 at 8:02

In Magento 2.1.1 you are able to content deploy specific themes and also exclude themes by this commands:

Content Deploy specific themes By this command:

php bin/magento setup:static-content:deploy --theme Vendor/firsttheme --theme Vendor/secondtheme

Also you can exclude themes By this command:

php bin/magento setup:static-content:deploy --exclude-theme Vendor/yourtheme

If you need deploys static content for particular language (en_US), and exclude other theme, and need not minify HTML files then use this command:

magento setup:static-content:deploy en_US --exclude-theme Vendor/yourtheme --no-html-minify
| improve this answer | |

You can try delete your theme static content in pub/static/frontend/YOURTHEME, and clear cache - refresh site to view change.

| improve this answer | |
  • can we run static-content:deploy for specific theme or not if we run the command it will create all theme i dont want to create all theme again just i need to re deploy only my theme – Pradeep Kumar Jan 6 '16 at 7:03

It seems frontend argument only has info:language:list for list of available locales please refer docs

| improve this answer | |

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.