A faster route to deploying static content in Magento 2? Dev to Live etc?

前端 未结 8 739
名媛妹妹
名媛妹妹 2021-01-30 07:02

This is my environment. Please note this is also set in the relevant development modes and production modes.

Dev:
https://ar.dev.loc/
https://en.dev.loc/

Live:
         


        
8条回答
  •  长发绾君心
    2021-01-30 07:54

    I have come with a solution for this problem.

    You have to publish the content of the store you want by

    php bin/magento setup:static-content:deploy [lang(en_US)] -t [vendor]/[theme]
    

    I won't change because magento cache, so just delete it manually

    rm -rf pub/static/_*/*
    
    php bin/magento cache:flush; php bin/magento cache:clean;
    

    The refresh your page and done now it takes new changes when it regenerates de page.

    This steps are mandatory for changes in phtml and static content, layout changes require cache flush, and changes on controllers are a pain in the arsh because you need to use di:compile this one really make you leave from production.

提交回复
热议问题