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 ?

asked Mar 2, 2019 at 10:41
1
  • Can you please tell me which Frontend Development Workflow are you using? I mean client side scripting or server side scripting Commented Mar 2, 2019 at 14:31

1 Answer 1

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 :)

answered Mar 2, 2019 at 10:50
2
  • 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 Commented Mar 2, 2019 at 11:58
  • Yes, it does happen in few of the version. Commented Mar 2, 2019 at 12:53

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.