Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot see changes in Magento 2 js and css

I am new to magento 2 and I am creating extension for it.

But I am unable to see any js and css changes.

When i check on my source code my js file custom.js and css file custom.css is loaded properly but i am unable to see any of my changes.

I tried to clear cache and didn't get any result.

I cleared cache from backed and manually as well and disabled all cache too.

like image 990
Yatin Khullar Avatar asked Feb 01 '16 13:02

Yatin Khullar


3 Answers

step 1. delete all folders under pub/static/frontend

step 2. delete cache folder under var/cache

Now open your command prompt and go to your root installation of magento 2 and fire the following commands

step 3. php bin/magento setup:static-content:deploy

step 4. php bin/magento indexer:reindex

The above step worked for me. I hope it will work for you also.

Let me know if you still facing any problem.

like image 94
samumaretiya Avatar answered Nov 15 '22 05:11

samumaretiya


step 1.

rm -rf pub/static/frontend/*

step 2.

rm -rf var/cache/*

step 3.

php bin/magento s:s:d -f

step 4.

php bin/magento indexer:reindex

The above step worked for me. I hope it will work for you also.

like image 3
Asad Ullah Riaz Avatar answered Nov 15 '22 05:11

Asad Ullah Riaz


To work efficient it is possible to use the following command to do all tasks together:

rm -rf var/view_preprocessed; rm -rf pub/static/frontend/*; rm -rf var/cache/*; php bin/magento setup:static-content:deploy -f de_DE;
like image 1
Urs Bo Avatar answered Nov 15 '22 05:11

Urs Bo