cancel
Showing results for 
Search instead for 
Did you mean: 

Files in pub/static being deleted over and over again - HELP!!

Files in pub/static being deleted over and over again - HELP!!

Hi All,

 

For some reason, when certain changes are applied via backend, ALL files in pub/static are deleted - over and over again. I restore them, make a few changes - puff, they're gone.

 

Can someone help? What is going on?

Thanks!

4 REPLIES 4

Re: Files in pub/static being deleted over and over again - HELP!!

Hello Lisali,

The content of pub/static is generated when you install you Magento or when deploy your static content. When it deleted you have to regenerate your static content.

Please run the following command from your Magento root directory:

  

  php bin/magento setup:static-content:deploy

 

after successful deployment provide the appropriate permission to the pub directory.

 

Please let me know if you have any issue.

Re: Files in pub/static being deleted over and over again - HELP!!

Hi,

 

Thanks so much for your message.

 

Why is this being deleted though? I am trying Magento 2 because it promised to be leaner and easier to use than Magento 1. However, I don't get why so much has to be done via command line? Why are these settings not available in the GUI backend?

 

I am so confused!

 

Thanks!

Re: Files in pub/static being deleted over and over again - HELP!!

Basically Magento keep there static content on pub/static folder so that it can be used more easly and fastest way. For example css and js are kept here , these are the static content no need to generate every time on production server it generated once and used life time. If you make any changes on css or js you need to regenerate these content. Change your mode to development.

 

No, there is no any UI to re-generate the static content.You need to use comman line. It very fast and easy way to use command line.

Re: Files in pub/static being deleted over and over again - HELP!!

Hi,

 

Thanks so much for your response. But why is it like this? Why did the developers decide to make it more difficult to use?

 

How do I use command line? Via SSH?

 

So EVERY single time I make ANY changes to css, HTML or JS, pub/static has to be regenerated MANUALLY?

 

What about changes to back end settings, and for example, minifying and combining JS - does that require a manual recompilation?

 

Thanks!