亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

php - What is the difference between the mix method and asset method in Laravel?
巴扎黑
巴扎黑 2017-05-16 13:09:08
0
1
487

I am new to laravel. When referencing resources, I saw that there are asset methods and mix methods, which both return the same directory. I would like to ask what is the difference between the two?

巴扎黑
巴扎黑

reply all(1)
漂亮男人

Laravel comes with laravel-mix, which is used to package static resources such as js, css, images, etc. The name of the generated file will be: app.asjduiik2l1323879dasfydua23.js, 即js原文件名+hash+.js后綴,因?yàn)橹虚g的那個(gè)hash是隨時(shí)會變化的,所以在頁面引入js文件的時(shí)候,就不能寫死文件的路徑,而是使用mix('app.js'),此時(shí)laravel會自動去匹配當(dāng)前的app.js對應(yīng)哪個(gè)app+hash+.js的文件(項(xiàng)目public目錄下會有一個(gè)mix-manifest.json, which stores the corresponding relationship between the two, and the file will be updated every time the static resources are packaged).

Sometimes we don’t want the hash value to be added to the name of the static resource (in most cases, it is a third-party library that is not a nodejs module and is introduced independently). At this time, we can directly use the asset method, which is simple and crude. Look for the file you named it.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template