Skip to main content
Share Your Experience: Take the 2024 Developer Survey
83 votes
Accepted

Magento 2: How can I deploy my theme only

As of 2.1.1 you can now deploy specific themes or exclude themes: Deploy specific themes: php bin/magento setup:static-content:deploy --theme Magento/backend --theme Vendor/mytheme Exclude themes: ...
Mathew Tinsley's user avatar
25 votes

Magento2: Re generate css file in pub/static folder

answers here don't mention that you shouldn't delete the .htaccess in the pub/static folder. to delete all files except the .htacces enter the pub/static directory and run cd ./pub/static/ find . -...
Claudiu Creanga's user avatar
25 votes
Accepted

Running php bin/magento setup:static-content:deploy for different languages

bin/magento setup:static-content:deploy en_GB or if you want for multiple languages: bin/magento setup:static-content:deploy en_GB en_US ro_RO
Marius's user avatar
  • 198k
19 votes
Accepted

Static content deploy issue

Solution is deprecated: Do not Not used it. Bad idea to switch to default It got a solution, which may not be 100% right. First I change change current application mode to default from developer at ...
Amit Bera's user avatar
  • 77.5k
18 votes

Magento 2: How can I deploy my theme only

In Magento 2 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 --...
Prince Patel's user avatar
  • 22.7k
18 votes
Accepted

Magento 2, issue with getting "version" number in file paths

We can disable it in Admin: Stores > Configuration > Advanced > Developer > Sign Static Files Or we can change directly the value in core_config_data: insert into core_config_data (config_id, ...
Khoa TruongDinh's user avatar
14 votes
Accepted

app/etc/config.php in VCS or not

There's nothing wrong with including config.php in VCS if your needs are based on configuration being the same across various environments, especially the on/off states of your modules. The side ...
mkotov's user avatar
  • 416
13 votes
Accepted

Why I cannot switch into given mode "develop"?

That's because the mode is called developer, not develop
Fabian Schmengler's user avatar
12 votes

Fatal error: Class 'Locale' not found magento 2.0.2

This error occurs when you do not have php's intl extension. For futher info. you can chk https://github.com/magento/magento2/issues/2316 Run Grunt deploy task -> Fatal error: Class 'Locale&...
Arjun's user avatar
  • 3,586
10 votes

Magento 2: How can I deploy my theme only

Here is shortcut to deploy only your theme -a for area -t for theme -l for language php bin/magento setup:static-content:deploy -l en_US -a frontend -t Magento/luma Source
Qaisar Satti's user avatar
  • 32.5k
10 votes

Magento2: Re generate css file in pub/static folder

Simple way 1 In the Magento Admin. Go to System > Tools > Cache Management and click Flush Static Files Cache. Simple way 2 If you just changed the css file which already existing, what you ...
Key Shang's user avatar
  • 3,425
9 votes

Magento2: Re generate css file in pub/static folder

There is one important note to make about this question that most of the answers don't specifically point out. In your case (with the set up you are using) the reason your CSS changes aren't getting ...
circlesix's user avatar
  • 4,293
9 votes

Magento2: Re generate css file in pub/static folder

As the question is for js and css update in Magento 2 in developer mode. Updating the JS in your respected module,before refreshing page the same file from pub/static/frontend/namespace/theme/ ... ...
Kanhaiya lal's user avatar
  • 1,548
8 votes

Magento 2 setup:static-content:deploy symlinks

I was able to resolve this by adding this node in app/etc/di.xml <type name="Magento\Deploy\Model\Deploy\LocaleDeploy"> <arguments> <argument name="...
Sergey Boyko's user avatar
7 votes

Magento2: Re generate css file in pub/static folder

do not forget to run the grunt exec:theme, grunt less:theme commands where theme is the theme you declared in the themes.js file from the config folder of grunt ( all this is in the developer guide ) ...
Vlad Patru's user avatar
  • 1,200
7 votes

Magento 2: Can't switch from developer to production: "Command returned non-zero exit code:"

Turns out Magento was not able to compile on my SiteGround build. I could switch it back when I ran; /usr/local/php56/bin/php-cli bin/magento deploy:mode:set production --skip-compilation Stay away ...
Aus-tn's user avatar
  • 177
7 votes
Accepted

Run Grunt deploy task -> Fatal error: Class 'Locale' not found

You php do not have intl extension. You can verify it by run php -i. In many cases this problem appear when you have different php version/configurations for apache and cli. For example if use ...
KAndy's user avatar
  • 20.9k
7 votes
Accepted

magento 2.0 theme not working in 2.1

I was facing the same problem and did the following steps to fix it First make a backup of your theme from app/design/frontend/theme Set the blank theme from admin->content->configurations for ...
Waqar's user avatar
  • 974
7 votes
Accepted

Magento 2 - no css after pub folder has been deleted

Don't delete the entire pub folder. Delete pub/static/* if/when needed. You are most likely missing three critical files that will not be automatically regenerated: pub/.htaccess pub/media/....
Ryan Hoerr's user avatar
  • 12.3k
6 votes

Magento2 static-content:deploy not generating admin

try to run: php bin/magento setup:static-content:deploy --area adminhtml
Manish Joy's user avatar
  • 1,215
6 votes

Magento2: Re generate css file in pub/static folder

Run these commands on your Magento root folder: alias mage="php -d memory_limit=-1 -f bin/magento" chmod -R 775 pub/static/ var/ pub/media/ && rm -rf var/view_preprocessed/ var/cache/ var/...
Rafael Corrêa Gomes's user avatar
6 votes

Magento2: Re generate css file in pub/static folder

Ok so based on what I have read in various other posts and my personal experience here is the process to regenerate the CSS or any Static Content: php bin/magento setup:upgrade This will wipe out ...
Vallier's user avatar
  • 221
6 votes

Magento 2, issue with getting "version" number in file paths

Run the following commands and you will see static version number in the static URLs (CSS, JS etc.) bin/magento config:set dev/static/sign 1 bin/magento cache:clean bin/magento cache:flush Hope it ...
Gagan Nayyar's user avatar
5 votes
Accepted

how to speed up static content deploy for development

delete all your static content deploy the static content with bin/magento setup:static-content:deploy <languages> change whatever file you need to change ie. <vendor>/.../web/template/...
steros's user avatar
  • 1,622
5 votes

Magento2 deploy command not working and rest commands are working

This issue generally occurs when you keep backup folders in module/theme view files app/code/{{namespace}}/{{module}}/view or app/design/... Remove backup files and try again, it would be working ...
Himmat Paliwal's user avatar
5 votes

Attempting to pass access keys into composer create-project for automated install

As usual, immediately after asking the question, i figure out the answer. I need to add a file ~/.composer/auth.json with the following: { "http-basic": { "repo.magento.com": { ...
CarComp's user avatar
  • 1,256
5 votes

Attempting to pass access keys into composer create-project for automated install

Another option is to set the access keys using the composer config command just before running the composer create-project command composer config -g http-basic.repo.magento.com $MAGENTO_PUBLIC_KEY $...
Saroj's user avatar
  • 477
5 votes
Accepted

Setup Folder does not get populated when using magento-deploy-ignore in Composer

I always thought this magento-deploy-ignore was a per file but its actually per map definition in the modules composer json. The code in the magento composer installer that creates the files looks ...
Luke Rodgers's user avatar
  • 4,452
4 votes

Magento2: Re generate css file in pub/static folder

Couldn't you just flush static cache in the admin panel and then run php bin/magento setup:static-content:deploy
babywit's user avatar
  • 659

Only top scored, non community-wiki answers of a minimum length are eligible