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

前端 未结 8 745
名媛妹妹
名媛妹妹 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:46

    yes it can be faster by following steps :

    1. Change in your js/css file in app directory
    2. Now Delete the file form pub/static folder

    you can find the file in pub static by following command

    find pub/static -iname yourjsfile.js
    
    1. remove only that file in which you have changes from pub/static folder
    2. make sure that pub/static.htaccess file & pub/static.php file is there
    3. assign file write permissions to pub folder
    4. now hit the URL in browser .htaccess will directly deploy missing js file

    .htaccess in pub/static send the missing files to pub/static.php with parameter resource and pub/static.php file creates an StaticResource for the file if available and deploy that.

    Note: this only works with apache mod_rewrite

    For Nginx you need to configure the same via nginx.conf.sample

提交回复
热议问题