1

When I delete the pub/static/frontend or backend folder, everything falls on the frontend and backend, and every time I need to call static-content: deploy for everything to work fine. Using developer mode

why can help me ?

  • Can you please tell me which Frontend Development Workflow are you using? I mean client side scripting or server side scripting – Shankar Mar 2 at 14:31
1

Magento 2 generates JS,css and HTML to pub/static in order to make the website more faster and it's like caching.

So each time when you remove and it has to be generated again manually via Command.

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

The static view files deployment command enables you to write static files to the Magento file system when the Magento software is set for production mode.

The term static view file refers to the following:

“Static” means it can be cached for a site (that is, the file is not dynamically generated). Examples include images and CSS generated from LESS.

“View” refers to presentation layer (from MVC).

Static view files are located in the /pub/static directory, and some are cached in the /var/view_preprocessed directory as well.

Static view files deployment is affected by Magento modes as follows:

“Default“ and “developer“ modes: 
1.) Magento generates them on demand, but the rest are cached in a file for speed of access.

Production mode: Static files are not generated or cached. You must write static view files to the Magento file system manually using the command.

Refer this

Hope this helps :)

  • Prathap Gunasekaran, thanks for answer. Mode is developer and i think it's to be deployed automatically, another my magento project there i only remove frontend and each time i don't deployed static content and it's work fine – Robinio Mar 2 at 11:58
  • Yes, it does happen in few of the version. – Prathap Gunasekaran Mar 2 at 12:53

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.