Magento 2 changes in Js and CSS

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

But I do not see js and css changes.

When I check my source code, my js file custom.js and the css file custom.css loads correctly, but I do not see any changes.

I tried to clear the cache and did not get any result.

I cleared the cache from the backup and manually, and also disabled all the cache.

Please help me with this.

+6
source share
3 answers

Step 1. Delete all folders in the / static / frontend folder

step 2. delete the cache folder in var / cache

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

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

Step php bin/magento indexer:reindex

This step worked for me. I hope this works for you too.

Let me know if you still encounter any problem.

+2
source

Perhaps this is because the basic CSS rule takes precedence over your CSS rule for the same DOM element. You should check it using the browser developer tools.

-1
source

Requiring JS will cache the changes to your javascript files (even in developer mode). To disable caching, add below to MyNamespace / MyModule / view / frontend / requirejs-config.js

 var config = { urlArgs: "bust=" + (new Date()).getTime() }; 
-1
source

All Articles