Question

I've recently deployed a magento 2 from local to live environment, local was working fine and everything was running smoothly. I've also enabled production mode, but i've not turned on css or js compression.

When i did an rsync from my local machine to the live box, the build stopped working, I had to run the:

bin/magento

Command on the live server, to recompile the theme by doing a static content deploy:

bin/magento setup:static-content:deploy

Before this the theme doesn't work, after works fine.

What's changing from rsyncing the files to the server, why can't i run it on a build server and sync it. Sorry for the so many 'whys?' but i'd like to understand how to do it without running any commands on the server. Or is this not possible?

Thanks.

Was it helpful?

Solution

so you did not have compression activated on local, but on production, and then uploaded all files?

When compression is activated, all js and css files are renamed to .min.js/css

so if you just upload the files wihtout the .min. part from your local env, magento can't find them because it's searching for the .min. files in the pub/static folder as soon as compression is activated

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top